* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fafbfc;
    min-height: 100vh;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    text-align: center;
    margin-bottom: 60px;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.header h1 i {
    color: #0a66c2;
    margin-right: 12px;
}

.header p {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
}

.search-section {
    margin-bottom: 40px;
}

.search-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-container:focus-within {
    border-color: #0a66c2;
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.search-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    font-size: 0.95rem;
    outline: none;
    background: transparent;
    color: #1a1a1a;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    background: #0a66c2;
    color: white;
    border: none;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-btn:hover {
    background: #084c87;
}

.search-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}


.performance-summary {
    background: white;
    border: 1px solid #e5e7eb;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.performance-summary h3 {
    margin-bottom: 24px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.performance-summary h3 i {
    color: #6b7280;
    font-size: 1rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 24px;
}

.summary-item {
    text-align: center;
    padding: 0;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.summary-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.loading {
    text-align: center;
    color: #6b7280;
    margin: 60px 0;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #0a66c2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-section {
    background: transparent;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.results-count {
    background: #f3f4f6;
    color: #6b7280;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.results-container {
    display: grid;
    gap: 20px;
}

.post-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.author-headline {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.post-date {
    color: #999;
    font-size: 0.85rem;
    font-weight: 500;
}

.post-content {
    margin-bottom: 16px;
}

.post-text {
    color: #333;
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-text.truncated {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.show-more {
    color: #0077b5;
    cursor: pointer;
    font-weight: 500;
    border: none;
    background: none;
    padding: 0;
    font-size: inherit;
}

.show-more:hover {
    text-decoration: underline;
}

.post-attachments {
    margin-bottom: 16px;
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.attachment-item {
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.attachment-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.attachment-item img:hover {
    transform: scale(1.05);
}

.post-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.9rem;
}

.stat-item i {
    color: #0077b5;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-post-btn {
    background: #0077b5;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.view-post-btn:hover {
    background: #005885;
}

.error-message {
    text-align: center;
    color: white;
    background: rgba(220, 53, 69, 0.9);
    padding: 20px;
    border-radius: 12px;
    margin: 40px 0;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .search-container {
        flex-direction: column;
    }

    .search-btn {
        justify-content: center;
    }

    .results-section {
        padding: 20px;
    }

    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .post-card {
        padding: 20px;
    }

    .post-stats {
        flex-wrap: wrap;
        gap: 15px;
    }

    .post-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    max-height: 80%;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

/* Compact View Styles */
.results-container.compact-view {
    display: block;
}

.post-card.compact {
    padding: 16px 20px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    border-radius: 6px;
}

.post-card.compact:hover {
    border-left-color: #0a66c2;
    background: #f9fafb;
}

.post-card.compact.expanded {
    border-left-color: #0a66c2;
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.compact-author {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.compact-author-info {
    flex: 1;
}

.compact-author-name {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.compact-author-headline {
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.3;
}

.compact-stats {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-right: 12px;
}

.compact-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 500;
}

.compact-stat i {
    color: #9ca3af;
    font-size: 0.75rem;
}

.compact-date {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 8px;
}

.expand-arrow {
    color: #9ca3af;
    font-size: 1rem;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.post-card.compact.expanded .expand-arrow {
    transform: rotate(180deg);
}

.compact-details {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.post-card.compact.expanded .compact-details {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.compact-text {
    color: #333;
    line-height: 1.6;
    margin-bottom: 16px;
}

.compact-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* Performance indicators */
.performance-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.performance-high {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #d1fae5;
}

.performance-medium {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.performance-low {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Pagination Styles */
.pagination-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.load-more-btn {
    background: #0a66c2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.load-more-btn:hover {
    background: #084c87;
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.load-more-btn.loading {
    background: #ccc;
    cursor: not-allowed;
}

.load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

.pagination-info {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Estimated Impressions Styles */
.estimated-impressions {
    background: #f0f9ff;
    border: 1px solid #e0f2fe;
    border-radius: 4px;
    padding: 2px 6px;
}

.estimated-impressions i {
    color: #0369a1 !important;
}

.estimated-impressions small {
    font-size: 0.65rem;
    color: #6b7280;
    margin-left: 2px;
}
