/* Analytics Pages - Professional Styles */

/* ========================================
   Header & Date Range
======================================== */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.content-header-left h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.content-header-left p {
    font-size: 14px;
    color: var(--gray-400);
    margin: 0;
}

.content-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.date-range-selector {
    display: flex;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.date-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.date-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.date-btn.active {
    color: #fff;
    background: var(--red-500);
}

/* ========================================
   Filters Bar
======================================== */
.analytics-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select {
    padding: 8px 32px 8px 12px;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 8px;
    color: var(--gray-300);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 140px;
}

.filter-select:hover {
    border-color: rgba(75, 85, 99, 0.6);
}

.filter-select:focus {
    outline: none;
    border-color: var(--red-500);
}

.filter-select option {
    background: var(--gray-800);
    color: #fff;
}

/* Toggle Switch */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.filter-toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--gray-700);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.filter-toggle input:checked + .toggle-slider {
    background: var(--red-500);
}

.filter-toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-300);
}

/* ========================================
   Stats Cards
======================================== */
.analytics-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.analytics-stat-card:hover {
    border-color: rgba(75, 85, 99, 0.5);
    background: rgba(17, 24, 39, 0.8);
}

.analytics-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-500);
    flex-shrink: 0;
}

.analytics-stat-card .stat-icon.brand {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.analytics-stat-card .stat-icon.platforms {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.analytics-stat-card .stat-icon.queries {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.analytics-stat-card .stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.analytics-stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.analytics-stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-400);
}

/* ========================================
   Chart Section
======================================== */
.analytics-chart-section {
    margin-bottom: 24px;
}

.chart-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 16px;
    padding: 24px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.legend-item:hover {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.5);
}

.legend-item.active {
    border-color: var(--red-500);
}

.legend-item.dimmed {
    opacity: 0.4;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-domain {
    color: var(--gray-300);
    font-weight: 500;
}

.legend-count {
    color: var(--gray-500);
    font-size: 12px;
}

.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

/* Data Collection Notice */
.data-notice {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.data-notice-dot {
    width: 8px;
    height: 8px;
    background: var(--red-500);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.data-notice-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--red-400);
}

/* ========================================
   Platform Breakdown
======================================== */
.analytics-breakdown {
    margin-bottom: 24px;
}

.breakdown-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 16px;
    padding: 24px;
}

.breakdown-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px 0;
}

.platform-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.platform-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.platform-bar-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 160px;
    flex-shrink: 0;
}

.platform-bar-favicon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.platform-bar-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-300);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.platform-bar-wrapper {
    flex: 1;
    height: 28px;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.platform-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.platform-bar-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100px;
    flex-shrink: 0;
    justify-content: flex-end;
}

.platform-bar-count {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.platform-bar-percent {
    font-size: 13px;
    color: var(--gray-500);
}

/* ========================================
   Loading & Empty States
======================================== */
.analytics-loading,
.analytics-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.analytics-loading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(239, 68, 68, 0.2);
    border-top-color: var(--red-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.analytics-loading p {
    color: var(--gray-400);
    font-size: 14px;
}

.analytics-empty .empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(75, 85, 99, 0.2);
    border-radius: 20px;
    margin-bottom: 20px;
    color: var(--gray-500);
}

.analytics-empty .empty-icon svg {
    width: 40px;
    height: 40px;
}

.analytics-empty h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.analytics-empty p {
    font-size: 14px;
    color: var(--gray-400);
    max-width: 400px;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ========================================
   Table Section
======================================== */
.analytics-table-section {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.table-count {
    font-size: 14px;
    color: var(--gray-400);
}

.analytics-table-wrapper {
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(31, 41, 55, 0.3);
    white-space: nowrap;
}

.analytics-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--gray-300);
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
    vertical-align: middle;
}

.analytics-table tbody tr {
    transition: background 0.2s ease;
}

.analytics-table tbody tr:hover {
    background: rgba(31, 41, 55, 0.3);
}

.analytics-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Cell Styles */
.table-query {
    font-weight: 500;
    color: #fff;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-url {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

.table-url-favicon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.table-url-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--gray-300);
}

.table-url a {
    color: var(--gray-300);
    transition: color 0.2s ease;
}

.table-url a:hover {
    color: var(--red-400);
}

.table-platform {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-platform-favicon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.table-platform-name {
    font-weight: 500;
}

.table-provider {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(31, 41, 55, 0.6);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.table-provider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.table-date {
    white-space: nowrap;
    color: var(--gray-500);
}

/* Brand Column */
.table-brand {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.table-brand-unknown {
    font-size: 14px;
    color: var(--gray-600);
}

/* Source Column (domain) */
.table-source {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-source-favicon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.table-source-domain {
    font-size: 13px;
    color: var(--gray-400);
}

/* Legacy - Cited Domain Column (keep for backwards compat) */
.table-cited-domain {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-domain-favicon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.table-domain-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

/* Page Column */
.table-page {
    max-width: 250px;
}

.table-page-link {
    display: block;
    color: var(--gray-400);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: color 0.2s ease;
}

.table-page-link:hover {
    color: var(--red-400);
}

.table-action {
    text-align: right;
}

.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 6px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-action-btn:hover {
    background: rgba(31, 41, 55, 0.6);
    border-color: rgba(75, 85, 99, 0.5);
    color: #fff;
}

/* Provider Pills */
.provider-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.provider-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
}

/* ========================================
   Pagination
======================================== */
.analytics-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
}

.analytics-pagination .pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 8px;
    color: var(--gray-300);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.analytics-pagination .pagination-btn:hover:not(:disabled) {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.5);
    color: #fff;
}

.analytics-pagination .pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.analytics-pagination .pagination-info {
    font-size: 14px;
    color: var(--gray-400);
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1200px) {
    .analytics-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group .filter-select {
        flex: 1;
    }

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

    .chart-header {
        flex-direction: column;
    }

    .chart-legend {
        width: 100%;
        justify-content: flex-start;
    }

    .platform-bar-item {
        flex-wrap: wrap;
    }

    .platform-bar-info {
        width: 100%;
        margin-bottom: 8px;
    }

    .platform-bar-wrapper {
        flex: 1;
        min-width: 100px;
    }

    .analytics-table th,
    .analytics-table td {
        padding: 12px 16px;
    }

    .table-url {
        max-width: 180px;
    }

    .table-query {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 180px;
    }

    .analytics-stat-card {
        padding: 16px;
    }

    .analytics-stat-card .stat-value {
        font-size: 24px;
    }

    .legend-item {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* ========================================
   OVERVIEW PAGE STYLES
======================================== */

/* Overview Stats */
.overview-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.overview-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.overview-stat-card:hover {
    border-color: rgba(75, 85, 99, 0.5);
}

.overview-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.overview-stat-card.primary .stat-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--red-500);
}

.overview-stat-card.brand .stat-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.overview-stat-card.platforms .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.overview-stat-card.provider .stat-icon {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.overview-stat-card .stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.overview-stat-card .stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.overview-stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-400);
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Overview Cards */
.overview-card {
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.overview-card.wide {
    margin-bottom: 20px;
}

.overview-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.overview-card .card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.overview-card .card-subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

/* Category Distribution */
.category-distribution {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.category-item:hover {
    background: rgba(31, 41, 55, 0.6);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100px;
    flex-shrink: 0;
}

.category-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.category-icon.social { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.category-icon.reviews { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.category-icon.news { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.category-icon.reference { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.category-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-300);
}

.category-bar {
    flex: 1;
    height: 8px;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 4px;
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.category-bar-fill.social { background: #3b82f6; }
.category-bar-fill.reviews { background: #f59e0b; }
.category-bar-fill.news { background: #8b5cf6; }
.category-bar-fill.reference { background: #10b981; }

.category-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 80px;
    flex-shrink: 0;
    justify-content: flex-end;
}

.category-count {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.category-percent {
    font-size: 12px;
    color: var(--gray-500);
    width: 32px;
    text-align: right;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.category-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Top List */
.top-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-list-empty,
.provider-empty,
.recent-empty {
    padding: 24px;
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 8px;
}

.top-rank {
    width: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-align: center;
}

.top-favicon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.top-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-300);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar {
    width: 60px;
    height: 6px;
    background: rgba(31, 41, 55, 0.8);
    border-radius: 3px;
    overflow: hidden;
}

.top-bar-fill {
    height: 100%;
    background: var(--red-500);
    border-radius: 3px;
}

.top-count {
    width: 32px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-align: right;
}

/* Provider Distribution */
.provider-distribution {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.provider-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 120px;
    flex-shrink: 0;
}

.provider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.provider-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-300);
}

.provider-bar {
    flex: 1;
    height: 24px;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 6px;
    overflow: hidden;
}

.provider-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.provider-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 80px;
    flex-shrink: 0;
    justify-content: flex-end;
}

.provider-count {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.provider-percent {
    font-size: 12px;
    color: var(--gray-500);
}

/* Recent Citations */
.recent-citations {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(31, 41, 55, 0.3);
    border-radius: 8px;
    transition: background 0.2s ease;
    text-decoration: none;
}

.recent-item:hover {
    background: rgba(31, 41, 55, 0.5);
}

.recent-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

.recent-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recent-title {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
}

.recent-domain {
    color: var(--gray-400);
}

.recent-separator {
    color: var(--gray-600);
}

.recent-query {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-provider {
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.recent-date {
    font-size: 12px;
    color: var(--gray-500);
    flex-shrink: 0;
    width: 70px;
    text-align: right;
}

/* Citations Filter Bar */
.citations-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.citations-filter-bar .filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.citations-filter-bar .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.citations-filter-bar .filter-select {
    padding: 8px 32px 8px 12px;
    background: rgba(17, 24, 39, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: 6px;
    color: var(--gray-300);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 150px;
    transition: all 0.2s ease;
}

.citations-filter-bar .filter-select:hover {
    border-color: rgba(75, 85, 99, 0.6);
}

.citations-filter-bar .filter-select:focus {
    outline: none;
    border-color: var(--red-500);
}

.citations-filter-bar .filter-select option {
    background: var(--gray-800);
    color: #fff;
}

.filter-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: var(--red-400);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.filter-clear-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--red-300);
}

.filter-clear-btn svg {
    width: 14px;
    height: 14px;
}

@media (max-width: 768px) {
    .citations-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .citations-filter-bar .filter-group {
        width: 100%;
    }

    .citations-filter-bar .filter-select {
        width: 100%;
    }

    .filter-clear-btn {
        margin-left: 0;
        justify-content: center;
    }
}

/* Overview Citations Table */
.citations-table-container {
    overflow-x: auto;
}

.citations-table {
    width: 100%;
    border-collapse: collapse;
}

.citations-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
    background: rgba(31, 41, 55, 0.3);
}

.citations-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--gray-300);
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
    vertical-align: middle;
}

.citations-table tr:hover td {
    background: rgba(31, 41, 55, 0.4);
}

.citations-table .table-empty {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

.citations-table .table-provider {
    font-size: 13px;
    font-weight: 600;
}

.citations-table .table-query {
    max-width: 180px;
    font-size: 13px;
    color: var(--gray-400);
}

.citations-table .table-query span {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Overview Pagination */
.citations-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid rgba(75, 85, 99, 0.2);
}

.citations-pagination .pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 6px;
    color: var(--gray-300);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.citations-pagination .pagination-btn:hover:not(:disabled) {
    background: rgba(31, 41, 55, 0.8);
    border-color: rgba(75, 85, 99, 0.5);
    color: #fff;
}

.citations-pagination .pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.citations-pagination .pagination-info {
    font-size: 13px;
    color: var(--gray-400);
}

/* Overview Loading/Empty */
.overview-loading,
.overview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.overview-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(239, 68, 68, 0.2);
    border-top-color: var(--red-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.overview-loading p {
    color: var(--gray-400);
    font-size: 14px;
}

.overview-empty .empty-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(75, 85, 99, 0.2);
    border-radius: 16px;
    margin-bottom: 16px;
    color: var(--gray-500);
}

.overview-empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.overview-empty p {
    font-size: 14px;
    color: var(--gray-400);
    max-width: 360px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Overview Responsive */
@media (max-width: 1200px) {
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

@media (max-width: 768px) {
    .overview-stats {
        grid-template-columns: 1fr;
    }

    .overview-card {
        padding: 16px;
        overflow: hidden;
    }

    /* Category Distribution - Simplified row layout for mobile */
    .category-item {
        flex-wrap: nowrap;
        padding: 10px;
        gap: 8px;
    }

    .category-info {
        width: auto;
        flex: 0 0 auto;
        gap: 8px;
    }

    .category-icon {
        width: 28px;
        height: 28px;
    }

    .category-name {
        font-size: 13px;
    }

    .category-bar {
        flex: 1;
        min-width: 40px;
    }

    .category-stats {
        width: auto;
        flex-shrink: 0;
        gap: 4px;
    }

    .category-count {
        font-size: 13px;
    }

    .category-percent {
        font-size: 11px;
        width: auto;
    }

    /* Hide the arrow link on mobile to save space */
    .category-link {
        display: none;
    }

    /* Top List - Compact layout for mobile */
    .top-item {
        padding: 8px;
    }

    .top-name {
        min-width: 0;
        flex: 1;
    }

    .top-bar {
        width: 40px;
        flex-shrink: 0;
    }

    .top-count {
        width: 28px;
    }

    .provider-info {
        width: 100px;
    }

    .recent-item {
        flex-wrap: wrap;
    }

    .recent-content {
        flex: 1 1 calc(100% - 48px);
    }

    .recent-provider,
    .recent-date {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .overview-stat-card {
        padding: 16px;
    }

    .overview-stat-card .stat-value {
        font-size: 22px;
    }

    .overview-stat-card .stat-icon {
        width: 40px;
        height: 40px;
    }

    .overview-card {
        padding: 12px;
    }

    /* Category Distribution - Compact single row on small mobile */
    .category-item {
        padding: 8px;
        gap: 6px;
    }

    .category-info {
        gap: 6px;
    }

    .category-icon {
        width: 24px;
        height: 24px;
    }

    .category-icon svg {
        width: 12px;
        height: 12px;
    }

    .category-name {
        font-size: 12px;
    }

    .category-bar {
        min-width: 30px;
    }

    .category-count {
        font-size: 12px;
    }

    .category-percent {
        font-size: 10px;
    }

    /* Top List - Very compact on small mobile */
    .top-item {
        padding: 6px 8px;
    }

    .top-rank {
        width: 16px;
        font-size: 11px;
    }

    .top-favicon {
        width: 18px;
        height: 18px;
    }

    .top-name {
        font-size: 12px;
    }

    .top-bar {
        width: 30px;
    }

    .top-count {
        width: 24px;
        font-size: 12px;
    }
}
