/**
 * AI Poster Dashboard Styles
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f0f0f1;
    color: #1d2327;
    line-height: 1.6;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 30px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(34, 113, 177, 0.3);
}

.dashboard-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.dashboard-nav {
    display: flex;
    gap: 10px;
}

.dashboard-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dashboard-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.dashboard-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 500;
}

/* Filters */
.filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filters label {
    font-weight: 500;
    color: #50575e;
}

.filters select {
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.filters select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: #f0f6fc;
    border-radius: 12px;
    color: #2271b1;
}

.stat-icon.active {
    background: #edfaef;
    color: #00a32a;
}

.stat-icon.posts {
    background: #fcf0f1;
    color: #d63638;
}

.stat-icon.recent {
    background: #fef8ee;
    color: #dba617;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: #50575e;
    margin-top: 4px;
}

/* Charts */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1d2327;
}

.chart-card canvas {
    max-height: 300px;
}

/* Data Card */
.data-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1d2327;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f1;
}

table th {
    font-weight: 600;
    color: #50575e;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9f9f9;
}

table tr:hover {
    background: #f9f9f9;
}

table td a {
    color: #2271b1;
    text-decoration: none;
}

table td a:hover {
    text-decoration: underline;
}

/* Provider Badge */
.provider-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f6fc;
    color: #2271b1;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f1;
}

.pagination a {
    color: #2271b1;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.pagination span {
    color: #50575e;
}

/* View All Link */
.view-all {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f1;
    text-align: right;
}

.view-all a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.view-all a:hover {
    text-decoration: underline;
}

/* Footer */
.dashboard-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: #50575e;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .dashboard-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background: #1d2327;
        color: #f0f0f1;
    }

    .filters,
    .stat-card,
    .chart-card,
    .data-card {
        background: #2c3338;
    }

    .filters label,
    .stat-label {
        color: #a7aaad;
    }

    .stat-value,
    .chart-card h3,
    .data-card h3 {
        color: #f0f0f1;
    }

    .filters select {
        background: #3c434a;
        color: #f0f0f1;
        border-color: #50575e;
    }

    table th {
        background: #3c434a;
        color: #a7aaad;
    }

    table td,
    table th {
        border-bottom-color: #3c434a;
    }

    table tr:hover {
        background: #3c434a;
    }

    .pagination a {
        border-color: #50575e;
    }

    .view-all,
    .pagination {
        border-top-color: #3c434a;
    }
}
