:root {
    --primary-color: #2c6ecb;
    --secondary-color: #5d42a9;
    --dark-color: #1a2530;
    --light-color: #f8f9fa;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --border-color: #e5e8ed;
    --background-color: #f5f7fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--dark-color);
    line-height: 1.6;
}

header {
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-color);
}

.logo span {
    color: var(--secondary-color);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

nav ul li a:hover {
    color: var(--primary-color);
}

.main-container {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 2rem;
}

.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
}

.sidebar {
    background-color: white;
    border-radius: 6px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    height: fit-content;
    border: 1px solid var(--border-color);
}

.sidebar h3 {
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.filter-section {
    margin-bottom: 1.2rem;
}

.filter-section h4 {
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
    color: #555;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-option {
    display: flex;
    align-items: center;
}

.filter-option input {
    margin-right: 0.5rem;
}

.filter-option label {
    font-size: 0.9rem;
}

.content-area {
    background-color: white;
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.page-title {
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-color);
}

.search-container {
    margin-bottom: 1.5rem;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.search-box button {
    padding: 0.7rem 1.2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.search-box button:hover {
    background-color: #2159b3;
}

.platform-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.platform-tab {
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.platform-tab:hover {
    color: var(--primary-color);
}

.platform-tab.active {
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
}

.ad-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: white;
}

.ad-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.ad-image {
    width: 100%;
    height: 160px;
    background-color: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9rem;
}

.ad-content {
    padding: 1rem;
}

.ad-platform {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #e0e0e0;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
}

.ad-platform.facebook {
    background-color: #3b5998;
    color: white;
}

.ad-platform.tiktok {
    background-color: #000000;
    color: white;
}

.ad-platform.twitter {
    background-color: #1da1f2;
    color: white;
}

.ad-title {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
    line-height: 1.4;
}

.ad-card p {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.ad-meta {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.stats-container {
    margin-bottom: 1.5rem;
}

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

.stat-card {
    background-color: white;
    border-radius: 6px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

.chart-container {
    display: flex;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.platform-chart {
    width: 300px;
    height: 200px;
    margin: 0 auto;
}

footer {
    background-color: var(--dark-color);
    color: white;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-links ul {
    display: flex;
    list-style: none;
}

.footer-links ul li {
    margin-left: 1.5rem;
}

.footer-links ul li a {
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-links ul li a:hover {
    opacity: 1;
    text-decoration: underline;
}

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

.loading-indicator {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
}

/* Responsive styles */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    nav ul {
        margin-top: 0.5rem;
    }
    
    nav ul li {
        margin-left: 0;
        margin-right: 1rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .platform-chart {
        width: 100%;
    }
}