/* Twitter Posts Viewer Plugin Styles */

.twitter-posts-container {
    max-width: 600px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.twitter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e8ed;
}

.twitter-header h3 {
    margin: 0;
    color: #1da1f2;
    font-size: 1.4em;
}

.tpv-button {
    background-color: #1da1f2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.tpv-button:hover {
    background-color: #1991db;
}

.tpv-button:disabled {
    background-color: #aab8c2;
    cursor: not-allowed;
}

.tpv-loading {
    text-align: center;
    padding: 20px;
    color: #657786;
}

.tpv-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #1da1f2;
    border-radius: 50%;
    border-top-color: transparent;
    animation: tpv-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes tpv-spin {
    to {
        transform: rotate(360deg);
    }
}

.tpv-error {
    background-color: #ffe6e6;
    color: #d32f2f;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #d32f2f;
    margin-bottom: 20px;
}

.tpv-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tpv-post {
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow 0.2s;
}

.tpv-post:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tpv-post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.tpv-post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #1da1f2, #14171a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.tpv-post-info {
    flex-grow: 1;
    min-width: 0;
}

.tpv-post-username {
    font-weight: bold;
    color: #14171a;
    font-size: 15px;
}

.tpv-post-handle {
    color: #657786;
    font-size: 14px;
}

.tpv-post-time {
    color: #657786;
    font-size: 14px;
    white-space: nowrap;
}

.tpv-post-content {
    color: #14171a;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.tpv-post-stats {
    display: flex;
    justify-content: space-around;
    max-width: 300px;
    color: #657786;
    font-size: 13px;
}

.tpv-post-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tpv-post-stat:hover {
    background-color: #f7f9fa;
}

.tpv-post-stat span:first-child {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .twitter-posts-container {
        margin: 10px;
    }
    
    .twitter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tpv-post {
        padding: 12px;
    }
    
    .tpv-post-header {
        flex-wrap: wrap;
    }
    
    .tpv-post-stats {
        justify-content: flex-start;
        gap: 16px;
    }
}

/* Admin Styles */
.tpv-test-section {
    margin-top: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.tpv-test-section h2 {
    margin-top: 0;
}

#tpv-test-result {
    margin-top: 15px;
}

#tpv-test-result pre {
    background: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .tpv-post {
        background: #192734;
        border-color: #38444d;
        color: #ffffff;
    }
    
    .tpv-post-username {
        color: #ffffff;
    }
    
    .tpv-post-content {
        color: #ffffff;
    }
    
    .tpv-post-stat:hover {
        background-color: #283340;
    }
}
