/* 
 * SEO AI Tools Platform Styles
 * =============================
 * Modern, responsive dashboard for SEO tools and deployment monitoring
 * Updated: November 9, 2025
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    background: #f5f7fa;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   SIDEBAR NAVIGATION
   ============================================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 280px;
    height: calc(100vh - 60px);
    background: white;
    color: #1f2937;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: 70px;
    overflow-y: hidden;
    overflow-x: hidden;
}

/* Hide scrollbar completely in both expanded and collapsed states */
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.sidebar.collapsed::-webkit-scrollbar {
    display: none;
}

.sidebar.collapsed {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.sidebar-header {
    display: none; /* Hidden on desktop - logo/burger in top navbar */
    padding: 25px 15px;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: row-reverse;
}

/* Legacy styles kept for reference but header is hidden */
.sidebar-header h2 {
    font-size: 1.3em;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    transition: opacity 0.3s ease;
    text-align: left;
    flex: 1;
}

.sidebar.collapsed .sidebar-header h2 {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 25px 0;
    flex-direction: row;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #3b82f6;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    transition: all 0.3s ease;
    flex-shrink: 0;
    line-height: 1;
    padding: 0;
}

.sidebar-toggle:hover {
    color: #2563eb;
    transform: scale(1.1);
}

.sidebar-toggle:active {
    transform: scale(0.95);
}

.sidebar-nav {
    padding: 25px 0 20px 0; /* Added top padding since header is hidden */
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section:first-child {
    margin-top: 0; /* Reset since we have padding on sidebar-nav */
}

.nav-section-title {
    padding: 12px 20px 8px 20px;
    font-size: 0.6875em;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #80868b;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin: 4px 12px;
    color: #5f6368;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    gap: 16px;
    border-radius: 25px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    margin: 4px 0;
    border-radius: 0;
    gap: 0;
}

.nav-item:hover {
    background: #f1f3f4;
    color: #202124;
}

.nav-item.active {
    background: #e8f0fe;
    color: #3b82f6;
    font-weight: 500;
}

.nav-item.active .nav-icon {
    color: #3b82f6;
}

/* Collapsed sidebar active state */
.sidebar.collapsed .nav-item.active {
    background: #e8f0fe;
    border-radius: 0;
}

.nav-icon {
    font-size: 20px;
    min-width: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.2s ease;
    color: inherit;
}

/* Material Icons styling */
.nav-icon.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 300,
        'GRAD' 0,
        'opsz' 20;
}

.nav-item.active .nav-icon.material-symbols-outlined {
    font-variation-settings:
        'FILL' 1,
        'wght' 400,
        'GRAD' 0,
        'opsz' 20;
}

/* Ensure icons are perfectly centered in collapsed sidebar */
.sidebar.collapsed .nav-icon {
    margin: 0 auto;
}

.nav-text {
    font-size: 0.875em;
    font-weight: 400;
    white-space: nowrap;
    transition: opacity 0.2s ease;
    letter-spacing: 0.01em;
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.nav-badge {
    margin-left: auto;
    background: #e5e7eb;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 700;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-badge {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* ============================================================================
   MAIN CONTENT AREA
   ============================================================================ */

.main-content {
    margin-left: 280px;
    margin-top: 60px;
    padding: 30px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 60px);
    position: relative;
}

.main-content.sidebar-collapsed {
    margin-left: 70px;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.page-header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
    color: #1e293b;
}

.page-description {
    font-size: 1em;
    color: #64748b;
    margin-top: 5px;
}

/* Coming Soon Pages */
.coming-soon {
    max-width: 600px;
    margin: 100px auto;
    text-align: center;
    padding: 60px 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.coming-soon-icon {
    font-size: 5em;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.coming-soon h2 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #1e293b;
}

.coming-soon p {
    font-size: 1.1em;
    color: #64748b;
    margin-bottom: 30px;
}

.coming-soon-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.feature-item {
    text-align: left;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    color: #475569;
    font-size: 0.9em;
}

.coming-soon-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

/* ============================================================================
   ORIGINAL DASHBOARD STYLES (UPDATED FOR NEW LAYOUT)
   ============================================================================ */

/* Header - Updated for page header */
.header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    padding: 30px 35px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 0;
    color: white;
}

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

.stat-card {
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.stat-card .number {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card .label {
    font-size: 0.9em;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.completed {
    background: linear-gradient(135deg, #d1fae5 0%, white 100%) !important;
}

.stat-card.completed .number {
    color: #10b981;
}

.stat-card.failed {
    background: linear-gradient(135deg, #fecaca 0%, white 100%) !important;
}

.stat-card.failed .number {
    color: #ef4444;
}

.stat-card.in-progress {
    background: linear-gradient(135deg, #dbeafe 0%, white 100%) !important;
}

.stat-card.in-progress .number {
    color: #3b82f6;
}

.stat-card.pending {
    background: linear-gradient(135deg, #e9d5ff 0%, white 100%) !important;
}

.stat-card.pending .number {
    color: #a855f7;
}

.stat-card.success-rate {
    background: linear-gradient(135deg, #fef3c7 0%, white 100%) !important;
}

.stat-card.success-rate .number {
    color: #f59e0b;
}

.stat-card.avg-time {
    background: linear-gradient(135deg, #ede9fe 0%, white 100%) !important;
}

.stat-card.avg-time .number {
    color: #8b5cf6;
}

.stat-card.total {
    background: linear-gradient(135deg, #e5e7eb 0%, white 100%) !important;
}

.stat-card.total .number {
    color: #6b7280;
}

/* Filters */
.filters {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    /* Removed sticky positioning - filters will scroll with page */
}

.filter-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    padding: 10px 20px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #6b7280;
}

.filter-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Filter Controls (Sorting and Stage Filter) */
.filter-controls {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

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

.filter-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.filter-label .material-symbols-outlined {
    font-size: 18px;
    color: #3b82f6;
}

.filter-select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: white;
    color: #374151;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-select:hover {
    border-color: #3b82f6;
    background-color: #f0f9ff;
}

.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auto-refresh-toggle {
    color: #6b7280;
    font-size: 0.85em;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-refresh-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
}

.auto-refresh-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.refresh-interval-select {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.refresh-interval-select:hover {
    border-color: #3b82f6;
    background-color: #f0f9ff;
}

.refresh-interval-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.custom-interval-input {
    width: 70px;
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    font-size: 0.85em;
    transition: all 0.2s ease;
    font-weight: 500;
}

.custom-interval-input:hover {
    border-color: #3b82f6;
}

.custom-interval-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.custom-interval-input::placeholder {
    color: #9ca3af;
    font-size: 0.9em;
}

/* Deployment List */
/* Deployment list container - no longer used, kept for compatibility */
.deployment-list {
    display: contents; /* Makes children behave as if container doesn't exist */
}

.deployment-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.deployment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.deployment-domain {
    font-size: 1.4em;
    font-weight: bold;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 12px;
}

.website-favicon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    background: white;
    padding: 3px;
    border: 2px solid #e5e7eb;
}

.domain-link {
    color: #3b82f6;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.domain-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.deployment-base {
    color: #6b7280;
    font-size: 0.9em;
    margin-top: 5px;
}

.competitor-link {
    color: #3b82f6;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

.competitor-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.deployment-status {
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-pending {
    background: #e9d5ff;
    color: #6b21a8;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-label {
    margin-bottom: 10px;
    font-size: 0.95em;
    color: #6b7280;
    font-weight: 600;
}

.progress-bar-bg {
    background: #e9d5ff;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #d1fae5 0%, #a7f3d0 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #065f46;
    font-weight: bold;
    font-size: 0.85em;
    position: relative;
    overflow: hidden;
}

/* Progress bar fill - no animation needed (stages have animation) */
.progress-bar-fill.in-progress {
    background: linear-gradient(90deg, #d1fae5 0%, #a7f3d0 100%);
}

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

/* Stage Pipeline */
.stage-pipeline {
    margin: 25px 0;
}

.stage-pipeline-title {
    font-size: 0.95em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 15px;
}

.stage-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.stage-item {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stage-item.completed {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.stage-item.in-progress {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
}

.stage-item.failed {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.stage-item.pending {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.stage-icon {
    font-size: 1.5em;
    margin-bottom: 8px;
}

.stage-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.stage-name {
    font-size: 0.75em;
    font-weight: 600;
    color: #4b5563;
    margin-top: 5px;
}

.stage-item.completed .stage-name {
    color: #065f46;
}

.stage-item.in-progress .stage-name {
    color: #1e40af;
}

.stage-item.failed .stage-name {
    color: #991b1b;
}

.stage-item.pending .stage-name {
    color: #7c3aed;
}

/* Metadata */
.deployment-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Error Message */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 0.9em;
    border-left: 4px solid #ef4444;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* Deployment Logs Button - Blue */
/* Deployment Logs Button - Gray (Total Deployments) */
/* Deployment Logs Button - Gray (Total Deployments) */
.view-logs-btn {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    color: #374151;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 44px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    white-space: nowrap;
}

.view-logs-btn:hover {
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.view-logs-btn:active {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

/* Verify Deployment Button - Green (Completed) */
.verify-btn {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 44px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    white-space: nowrap;
}

.verify-btn:hover {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25);
}

.verify-btn:active {
    background: linear-gradient(135deg, #6ee7b7 0%, #34d399 100%);
}

/* Google Indexing Button - Blue (In Progress) */
.check-indexing-btn {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 44px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    white-space: nowrap;
}

.check-indexing-btn:hover {
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.25);
}

.check-indexing-btn:active {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
}

.verify-btn:disabled,
.check-indexing-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: rgba(0, 0, 0, 0.75);
    z-index: 1002;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    max-width: 1000px;
    margin: 20px auto;
    border-radius: 20px;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* Default Modal Header */
.modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-bottom: 2px solid #10b981;
    color: #ffffff;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Deployment Logs Modal Header - Gray */
#logModal .modal-header {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border-bottom: 2px solid #6b7280;
}

#logModal .modal-domain {
    color: #e5e7eb;
}

/* Deployment Verification Modal Header - Green */
#verifyModal .modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-bottom: 2px solid #10b981;
}

#verifyModal .modal-domain {
    color: #d1fae5;
}

/* Google Indexing Modal Header - Blue */
#indexingModal .modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-bottom: 2px solid #3b82f6;
}

#indexingModal .modal-domain {
    color: #dbeafe;
}

/* Search Performance Modal Header - Purple (Pending) */
#performanceModal .modal-header {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    border-bottom: 2px solid #a855f7;
}

#performanceModal .modal-domain {
    color: #e9d5ff;
}

/* Google Analytics Modal Header - Amber (Success Rate) */
#analyticsModal .modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-bottom: 2px solid #f59e0b;
}

#analyticsModal .modal-domain {
    color: #fef3c7;
}

.modal-header h2 {
    font-size: 1.6em;
    color: #ffffff;
}

.modal-domain {
    font-size: 0.85em;
    color: #d1fae5;
    font-weight: 600;
    display: inline;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.8em;
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    background: #f9fafb;
}

/* Keep loading messages centered */
.modal-body .loading {
    text-align: center !important;
}

.modal-body .loading * {
    text-align: center !important;
}

/* Keep error messages centered */
.modal-body .error-message {
    text-align: center !important;
}

.modal-body .error-message * {
    text-align: center !important;
}

/* Keep verification result messages centered */
.modal-body > div[style*="text-align: center"] {
    text-align: center !important;
}

/* Left-align specific content elements */
.modal-body h3 {
    text-align: left;
}

.modal-body table {
    text-align: left;
}

.modal-body p {
    text-align: left;
}

.modal-body .log-entry {
    text-align: left;
}

/* Log Entries */
.log-entry {
    padding: 18px;
    margin-bottom: 15px;
    border-radius: 12px;
    background: white;
    border-left: 4px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    text-align: left !important;
}

.log-entry * {
    text-align: left !important;
}

.log-entry:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateX(5px);
}

.log-entry.success {
    border-left-color: #10b981;
    background: linear-gradient(to right, #d1fae5 0%, white 100%);
}

.log-entry.error {
    border-left-color: #ef4444;
    background: linear-gradient(to right, #fee2e2 0%, white 100%);
}

.log-entry.info {
    border-left-color: #3b82f6;
    background: linear-gradient(to right, #dbeafe 0%, white 100%);
}

.log-entry.warning {
    border-left-color: #f59e0b;
    background: linear-gradient(to right, #fef3c7 0%, white 100%);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
    text-align: left !important;
}

.log-stage {
    font-weight: 600;
    color: #374151;
    font-size: 1em;
    text-align: left !important;
}

.log-time {
    font-size: 0.8em;
    color: #9ca3af;
}

.log-message {
    font-family: 'Courier New', 'Monaco', monospace;
    font-size: 0.9em;
    color: #4b5563;
    line-height: 1.7;
    word-break: break-word;
    white-space: pre-wrap;
    text-align: left !important;
}

.log-message strong {
    text-align: left !important;
}

/* Loading Spinner */
.loading {
    text-align: center !important;
    padding: 60px;
    color: #6b7280;
}

.spinner {
    border: 5px solid #f3f4f6;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

/* Last Updated */
.footer {
    text-align: center;
    color: #6b7280;
    font-size: 0.9em;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Pagination - Airbnb Style */
.pagination {
    background: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    position: relative;
}

.last-update-footer {
    background: white;
    padding: 15px 30px;
    border-radius: 0 0 15px 15px;
    text-align: center;
    color: #6b7280;
    font-size: 0.85em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    margin-top: -1px;
}

.pagination-spacer {
    display: none;
}

.pagination-buttons {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.pagination-size {
    position: absolute;
    right: 30px;
}

.pagination-btn {
    background: transparent;
    color: #3b82f6;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: #e0f2fe;
    color: #0369a1;
    transform: scale(1.04);
    border-radius: 50%;
}

.pagination-btn:disabled {
    background: transparent;
    color: #b0b0b0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Previous/Next arrow buttons - No circle */
.pagination-btn.pagination-prev,
.pagination-btn.pagination-next {
    border: none;
    background: transparent;
    padding: 6px 8px;
    min-width: 32px;
    width: 32px;
    height: 32px;
    color: #3b82f6;
}

.pagination-btn.pagination-prev:hover:not(:disabled),
.pagination-btn.pagination-next:hover:not(:disabled) {
    background: #e0f2fe;
    border-radius: 50%;
    color: #0369a1;
}

.pagination-btn.pagination-prev:disabled,
.pagination-btn.pagination-next:disabled {
    background: transparent;
    color: #d0d0d0;
}

.pagination-arrow {
    font-size: 1.2em;
    font-weight: 700;
    display: inline-block;
}

.pagination-btn.pagination-prev:hover:not(:disabled) .pagination-arrow,
.pagination-btn.pagination-next:hover:not(:disabled) .pagination-arrow {
    transform: scale(1.1);
}

.pagination-current {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.8em;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.pagination-ellipsis {
    color: #717171;
    padding: 6px 4px;
    font-weight: 600;
    font-size: 0.8em;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.pagination-size::before {
    content: 'Show';
    color: #64748b;
    font-size: 0.72em;
    font-weight: 500;
}

.pagination-size::after {
    content: 'per page';
    color: #64748b;
    font-size: 0.72em;
    font-weight: 500;
}

.page-size-select {
    padding: 4px 22px 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.72em;
    font-weight: 700;
    color: #3b82f6;
    background: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%233b82f6' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 9px;
    min-width: 50px;
}

.page-size-select:hover {
    border-color: #3b82f6;
    background-color: #f0f9ff;
}

.page-size-select:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Performance Modal Styles */
#indexingModal .modal-body,
#indexingModal .modal-body *,
#indexingModal .log-entry,
#indexingModal .log-entry *,
#indexingModal .log-header,
#indexingModal .log-header *,
#indexingModal .log-stage,
#indexingModal .log-message,
#indexingModal .log-message *,
#indexingModal h3,
#indexingModal div,
#indexingModal span,
#indexingModal strong,
#indexingModal p {
    text-align: left !important;
}

.performance-container {
    max-width: 100%;
}

.performance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.perf-card {
    /* No default background - will be set by specific classes */
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

/* Explicitly prevent hover effects on performance cards */
.perf-card:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.perf-card.clicks {
    background: linear-gradient(135deg, #dbeafe 0%, white 100%);
}

.perf-card.clicks .perf-value {
    color: #3b82f6;
}

.perf-card.impressions {
    background: linear-gradient(135deg, #ede9fe 0%, white 100%);
}

.perf-card.impressions .perf-value {
    color: #8b5cf6;
}

.perf-card.ctr {
    background: linear-gradient(135deg, #d1fae5 0%, white 100%);
}

.perf-card.ctr .perf-value {
    color: #10b981;
}

.perf-card.position {
    background: linear-gradient(135deg, #fef3c7 0%, white 100%);
}

.perf-card.position .perf-value {
    color: #f59e0b;
}

.perf-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.perf-value {
    font-size: 2.2em;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    text-align: center;
}

.perf-label {
    font-size: 0.9em;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.perf-date-range {
    background: #f3f4f6;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
    color: #374151;
    font-size: 0.95em;
}

/* Performance Chart */
.perf-chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.perf-chart-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #6b7280;
    font-size: 1.1em;
    font-weight: 400;
}

.chart-canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

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

.perf-chart-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.perf-chart-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #6b7280;
    font-size: 1.2em;
    font-weight: 400;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chart-label {
    min-width: 100px;
    font-weight: 600;
    color: #374151;
    font-size: 0.9em;
}

.chart-bar-bg {
    flex: 1;
    background: #f3f4f6;
    border-radius: 8px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    transition: width 0.6s ease;
    min-width: 60px;
}

.chart-bar.clicks-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.chart-bar.impressions-bar {
    background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
}

.chart-bar.ctr-bar {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.chart-bar.position-bar {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.chart-value {
    color: white;
    font-weight: 700;
    font-size: 0.9em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.top-pages {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.top-pages h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 1.2em;
}

.pages-table {
    overflow-x: auto;
}

/* Search Performance Button - Purple */
/* Search Performance Button - Purple (Pending) */
.view-performance-btn {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #6b21a8;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 44px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    white-space: nowrap;
}

.view-performance-btn:hover {
    background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
    box-shadow: 0 4px 8px rgba(168, 85, 247, 0.25);
}

.view-performance-btn:active {
    background: linear-gradient(135deg, #d8b4fe 0%, #c084fc 100%);
}

/* Google Analytics Button - Amber (Success Rate) */
.view-analytics-btn {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 44px;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    white-space: nowrap;
}

.view-analytics-btn:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.25);
}

.view-analytics-btn:active {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
}

/* Performance Date Selector */
.perf-date-selector {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-range-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.search-type-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.date-range-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
}

.perf-date-selector label {
    color: white;
    font-size: 0.95em;
    margin: 0;
    font-weight: 400;
}

.perf-date-selector select {
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: white;
    color: #6b7280;
    font-weight: 400;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.perf-date-selector select:hover {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.perf-date-selector select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

/* Analytics Date Selector - Orange */
.analytics-date-selector {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.analytics-date-selector .date-selector-label {
    color: white;
    font-size: 0.95em;
    margin: 0;
    font-weight: 500;
}

.analytics-date-selector select {
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: white;
    color: #6b7280;
    font-weight: 400;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.analytics-date-selector select:hover {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.analytics-date-selector select:focus {
    outline: none;
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.custom-date-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-date-inputs input[type="date"] {
    padding: 8px 12px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: white;
    color: #6b7280;
    font-size: 0.9em;
    cursor: pointer;
}

.custom-date-inputs span {
    color: white;
    font-size: 0.9em;
}

.custom-date-inputs button {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid white;
    background: white;
    color: #8b5cf6;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-date-inputs button:hover {
    background: #8b5cf6;
    color: white;
}

/* Analytics Modal - Orange Apply Button */
#analyticsModal .custom-date-inputs button {
    color: #ff6b35;
}

#analyticsModal .custom-date-inputs button:hover {
    background: #ff6b35;
    color: white;
}

.perf-date-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85em;
    text-align: right;
    white-space: nowrap;
}

/* Performance Data Tables */
.performance-tabs-nav {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    background: white;
    border-bottom: 2px solid #e5e7eb;
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px 8px 0 0; /* Top left and right rounded, bottom non-rounded */
}

.perf-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.perf-tab:hover {
    background: #f9fafb;
    color: #374151;
}

.perf-tab.active {
    background: transparent;
    color: #8b5cf6;
    border-bottom: 2px solid #8b5cf6;
    font-weight: 600;
}

.perf-tab-content {
    display: none;
}

.perf-tab-content.active {
    display: block;
}

.performance-tables-wrapper {
    background: white;
    border-radius: 0 0 8px 8px; /* Top non-rounded, bottom left and right rounded */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 25px;
    overflow: hidden;
}

.dimension-table-container {
    background: white;
    padding: 20px 25px;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    border-bottom: none;
}

.dimension-table-container:first-of-type {
    padding-top: 20px;
}

.dimension-table-container:last-of-type {
    padding-bottom: 25px;
}

.dimension-table-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #6b7280;
    font-size: 1.15em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dimension-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    margin-bottom: 20px;
    border-radius: 0 0 8px 8px; /* Bottom left and right rounded */
    border: 1px solid #e5e7eb;
    border-top: none; /* Remove top border as it connects to header */
    -webkit-overflow-scrolling: touch;
    position: relative;
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.dimension-table-wrapper::-webkit-scrollbar {
    display: none;
}

.dimension-table-header {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px 8px 0 0; /* Top left and right rounded */
    border: 1px solid #e5e7eb;
    border-bottom: none; /* Remove bottom border as it connects to wrapper */
    /* Hide scrollbar for all browsers */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.dimension-table-header::-webkit-scrollbar {
    display: none;
}

.dimension-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    background: white;
    table-layout: fixed;
}

/* Column widths for perfect alignment */
.dimension-table .col-dimension {
    width: 40%;
}

.dimension-table .col-clicks {
    width: 15%;
}

.dimension-table .col-impressions {
    width: 15%;
}

.dimension-table .col-ctr {
    width: 15%;
}

.dimension-table .col-position {
    width: 15%;
}

.dimension-table thead {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Round top corners of header */
.dimension-table-header .dimension-table thead tr:first-child th:first-child {
    border-radius: 8px 0 0 0;
}

.dimension-table-header .dimension-table thead tr:first-child th:last-child {
    border-radius: 0 8px 0 0;
}

.dimension-table th {
    padding: 14px 12px;
    text-align: center;
    font-weight: 400;
    color: #6b7280;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    user-select: none;
}

/* Left-align first column header (dimension) */
.dimension-table th:first-child,
.dimension-table th.col-dimension {
    text-align: left !important;
}

.dimension-table th.sortable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dimension-table th.sortable:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.dimension-table th.sorted-asc,
.dimension-table th.sorted-desc {
    background: #f3e8ff;
    color: #7c3aed;
}

.dimension-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.2s ease;
}

.dimension-table tbody tr:hover {
    background: #f9fafb;
}

/* Round bottom corners of last row in data section */
.dimension-table-wrapper .dimension-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 8px;
}

.dimension-table-wrapper .dimension-table tbody tr:last-child td:last-child {
    border-radius: 0 0 8px 0;
}

.dimension-table tbody tr.even {
    background: #fafafa;
}

.dimension-table tbody tr.even:hover {
    background: #f3f4f6;
}

.dimension-table td {
    padding: 12px;
    color: #4b5563;
    font-size: 0.9em;
    text-align: center;
}

.dimension-table td:first-child {
    text-align: left;
}

.dimension-table td.col-dimension {
    font-weight: 400;
    color: #6b7280;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left !important;
}

.dimension-table td.col-clicks {
    color: #3b82f6;
    font-weight: 400;
}

.dimension-table td.col-impressions {
    color: #8b5cf6;
    font-weight: 400;
}

.dimension-table td.col-ctr {
    color: #10b981;
    font-weight: 400;
}

.dimension-table td.col-position {
    color: #f59e0b;
    font-weight: 400;
}

.dimension-table .page-link {
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dimension-table .page-link:hover {
    color: #4b5563;
    text-decoration: underline;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 1.1em;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

/* Performance Pagination */
.perf-pagination {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

.perf-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.perf-page-number {
    color: #64748b;
    font-weight: 500;
    font-size: 0.72em;
}

.perf-page-btn {
    background: transparent;
    color: #3b82f6;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.perf-page-btn:hover:not(:disabled) {
    background: #e0f2fe;
    color: #0369a1;
    transform: scale(1.04);
    border-radius: 50%;
}

.perf-page-btn:disabled {
    background: transparent;
    color: #d0d0d0;
    cursor: not-allowed;
    opacity: 0.6;
}

.perf-page-size {
    position: absolute;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.perf-page-size::after {
    content: 'per page';
    color: #64748b;
    font-size: 0.72em;
    font-weight: 500;
}

.perf-page-size label {
    display: none;
}

.perf-page-size select {
    padding: 4px 22px 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 0.72em;
    font-weight: 700;
    color: #3b82f6;
    background: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%233b82f6' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 9px;
    min-width: 50px;
}

.perf-page-size select:hover {
    border-color: #3b82f6;
    background-color: #f0f9ff;
}

.perf-page-size select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Performance Data Tables - Tablet */
.performance-tabs-nav {
    padding: 12px 15px;
    gap: 6px;
}

.perf-tab {
    padding: 8px 14px;
    font-size: 0.85em;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 8px;
    }
    
    .header {
        padding: 25px 20px;
        border-radius: 15px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
        text-align: center;
    }
    
    /* Stats Cards - Tablet */
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    .stat-card .number {
        font-size: 2.2em;
    }
    
    .stat-card .label {
        font-size: 0.8em;
    }
    
    /* Filters - Tablet */
    .filters {
        padding: 12px !important;
        flex-direction: column !important;
        gap: 10px !important;
        border-radius: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .filter-buttons {
        width: 100% !important;
        justify-content: flex-start !important;
        padding-bottom: 10px !important;
        border-bottom: 1px solid #e5e7eb !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        row-gap: 8px !important;
    }
    
    .filter-btn {
        font-size: 0.85em !important;
        padding: 10px 16px !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 25px !important;
    }
    
    /* Filter Controls - Tablet */
    .filter-controls {
        width: 100% !important;
        flex-direction: row !important;
        gap: 10px !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
    }
    
    .filter-group {
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    
    .filter-label {
        font-size: 0.7em !important;
        white-space: nowrap !important;
    }
    
    .filter-select {
        font-size: 0.7em !important;
        padding: 6px 8px !important;
        min-width: auto !important;
    }
    
    .auto-refresh-toggle {
        align-self: flex-start !important;
        font-size: 0.75em !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }
    
    .auto-refresh-toggle label {
        gap: 5px !important;
        white-space: nowrap !important;
    }
    
    .auto-refresh-toggle input[type="checkbox"] {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }
    
    .refresh-interval-select {
        font-size: 0.75em !important;
        padding: 5px 8px !important;
        border-radius: 20px !important;
        min-width: auto !important;
    }
    
    .custom-interval-input {
        width: 60px;
        font-size: 0.8em;
        padding: 4px 8px;
        border-radius: 20px;
    }
    
    /* Deployment Items - Tablet */
    .deployment-item {
        padding: 20px !important;
        margin-bottom: 15px !important;
        border-radius: 12px !important;
    }
    
    .deployment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .deployment-domain {
        font-size: 1.2em;
    }
    
    .deployment-base {
        font-size: 0.85em;
    }
    
    .deployment-meta {
        font-size: 0.8em;
        gap: 15px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .deployment-status {
        font-size: 0.8em;
        padding: 8px 16px;
    }
    
    .progress-label {
        font-size: 0.9em;
    }
    
    .stage-pipeline-title {
        font-size: 0.9em;
    }
    
    .domain-title {
        font-size: 1.2em;
    }
    
    .stage-items {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .stage-item {
        padding: 10px;
    }
    
    /* Action Buttons - Horizontal scroll on mobile (modern app-style) */
    .action-buttons {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 10px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        scroll-behavior: smooth;
        padding-bottom: 5px; /* Space for scrollbar */
    }
    
    /* Hide scrollbar but keep functionality */
    .action-buttons::-webkit-scrollbar {
        height: 4px;
    }
    
    .action-buttons::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .action-buttons::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.3);
        border-radius: 2px;
    }
    
    .action-buttons::-webkit-scrollbar-thumb:hover {
        background: rgba(59, 130, 246, 0.5);
    }
    
    .view-logs-btn,
    .verify-btn,
    .check-indexing-btn,
    .view-performance-btn,
    .view-analytics-btn {
        flex: 0 0 auto; /* Don't shrink, don't grow, auto width */
        min-width: 140px; /* Minimum comfortable tap size */
        padding: 12px 20px !important;
        font-size: 0.85em !important;
        text-align: center;
        display: flex !important;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        white-space: nowrap;
    }
    
    .action-btn {
        font-size: 0.8em;
        padding: 7px 14px;
    }
    
    /* Modals - Tablet */
    .modal {
        padding: 10px !important;
    }
    
    .modal-content {
        margin: 10px auto !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        max-height: calc(100vh - 100px) !important;
    }
    
    .modal-header h2 {
        font-size: 1.3em;
    }
    
    .modal-body {
        padding: 20px;
        font-size: 0.9em;
    }
    
    /* Performance Date Selector - Tablet */
    .perf-date-selector {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .perf-date-selector label {
        font-size: 0.85em;
    }
    
    .perf-date-selector select {
        min-width: 130px;
        font-size: 0.85em;
        padding: 6px 12px;
    }
    
    .perf-date-info {
        font-size: 0.75em;
        width: 100%;
        margin-left: 0;
        text-align: right;
    }
    
    /* Custom Date Range Inputs - Stack on Tablet */
    .custom-date-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .custom-date-inputs input[type="date"],
    .custom-date-inputs button {
        width: 100%;
    }
    
    .custom-date-inputs span {
        text-align: center;
        font-size: 0.8em;
    }
    
    .performance-summary.compact {
        gap: 12px;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .top-pages.compact {
        padding: 15px;
    }
    
    .top-pages.compact h3 {
        font-size: 1em;
    }
    
    /* Performance Data Tables - Tablet */
    .dimension-table-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .dimension-table-container h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .dimension-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .dimension-table {
        font-size: 0.85em;
        min-width: 600px;
    }
    
    .dimension-table th {
        padding: 10px 8px;
        font-size: 0.8em;
    }
    
    .dimension-table td {
        padding: 10px 8px;
        font-size: 0.85em;
    }
    
    .dimension-table td.col-dimension {
        max-width: 250px;
    }
    
    .perf-pagination {
        flex-direction: column;
        gap: 12px;
        padding: 12px 0;
    }
    
    .perf-pagination-controls {
        gap: 12px;
    }
    
    .perf-page-btn {
        padding: 8px 14px;
        font-size: 0.85em;
    }
    
    .perf-page-number {
        font-size: 0.85em;
    }
    
    .perf-page-size {
        position: static;
        gap: 6px;
        justify-content: center;
        right: auto;
    }
    
    .perf-page-size label {
        font-size: 0.85em;
    }
    
    .perf-page-size select {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    
    /* Footer - Tablet */
    .footer {
        font-size: 0.85em;
        padding: 15px;
        border-radius: 12px;
    }
    
    /* Responsive Pagination */
    .pagination {
        padding: 15px 20px !important;
        gap: 12px !important;
        flex-direction: column !important;
        border-radius: 12px 12px 0 0 !important;
        margin-bottom: 0 !important;
    }
    
    .pagination-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 3px;
    }
    
    .pagination-size {
        position: static !important;
        justify-content: center;
    }
    
    .last-update-footer {
        font-size: 0.75em !important;
        padding: 12px 15px !important;
        border-radius: 0 0 12px 12px !important;
        margin-bottom: 15px !important;
    }
    
    .pagination-btn {
        font-size: 0.75em;
        padding: 5px 8px;
        min-width: 28px;
        height: 28px;
    }
    
    .pagination-btn.pagination-prev,
    .pagination-btn.pagination-next {
        padding: 5px 6px;
        min-width: 28px;
        width: 28px;
        height: 28px;
    }
    
    .pagination-current {
        font-size: 0.75em;
        padding: 5px 8px;
        min-width: 28px;
        height: 28px;
    }
    
    .pagination-ellipsis {
        font-size: 0.75em;
    }
    
    .pagination-size {
        gap: 7px;
        justify-content: center;
        width: auto;
    }
    
    .pagination-size::before {
        font-size: 0.68em;
    }
    
    .pagination-size::after {
        font-size: 0.68em;
    }
    
    .page-size-select {
        font-size: 0.68em;
        padding: 3px 18px 3px 6px;
        min-width: 45px;
    }
}

/* ================================
   TOP NAVIGATION BAR
   ================================ */

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1001;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.top-navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 0;
    flex-shrink: 0;
}

.top-navbar-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 720px;
    margin: 0 20px;
}

.top-navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    justify-content: flex-end;
}

.top-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3em;
    font-weight: 700;
    color: #1f2937;
}

.logo-icon {
    font-size: 1.5em;
    color: #3b82f6;
}

.logo-text {
    display: inline-block;
}

.mobile-menu-btn {
    display: flex; /* Show on all screen sizes */
    background: transparent;
    border: none;
    color: #3b82f6;
    width: 44px;
    height: 44px;
    border-radius: 50%; /* Circular */
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
    margin-left: -6px;
}

.mobile-menu-btn:hover {
    background: #f3f4f6; /* Light gray background on hover */
    color: #2563eb;
}

.mobile-menu-btn .material-symbols-outlined {
    font-size: 1.8em;
    font-weight: 400;
    line-height: 1;
}

.top-nav-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.top-nav-btn:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.top-nav-btn .material-symbols-outlined {
    font-size: 1.3em;
}

.top-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 50%; /* Circular like burger button */
    cursor: pointer;
    transition: all 0.2s ease;
    width: 44px;
    height: 44px;
    justify-content: center;
}

/* Circular hover background - matches burger button style */
.top-user-menu:hover {
    background: #f3f4f6;
}

.top-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
}

.top-user-avatar .material-symbols-outlined {
    font-size: 40px;
    color: #3b82f6;
    font-variation-settings:
        'FILL' 1,
        'wght' 300,
        'GRAD' 0,
        'opsz' 48;
}

.top-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.top-user-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #1f2937;
}

.top-user-role {
    font-size: 0.75em;
    color: #6b7280;
}

/* AI Search Bar (Gmail-style) */
.ai-search-bar {
    width: 100%;
    max-width: 720px;
    height: 44px;
    background: #f1f3f4;
    border-radius: 25px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: all 0.2s ease;
    position: relative;
}

.ai-search-bar:hover {
    background: #e8eaed;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ai-search-bar.focused {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ai-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95em;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ai-search-input::placeholder {
    color: #5f6368;
}

.search-clear-btn {
    background: transparent;
    border: none;
    color: #5f6368;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.search-clear-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1f2937;
}

.search-clear-btn .material-symbols-outlined {
    font-size: 1.1em;
}

/* ================================
   TOPNAV - RESPONSIVE
   ================================ */

/* Mobile - Compact top nav */
@media (max-width: 768px) {
    .top-navbar {
        padding: 0 0;
        gap: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .top-navbar-left {
        padding-left: 4px;
        gap: 8px;
        flex-shrink: 0;
    }
    
    /* Align burger button properly on mobile */
    .mobile-menu-btn {
        margin-left: 0;
    }
    
    /* Hide AI SEO text on mobile (shown in sidebar instead) */
    .logo-text {
        display: none;
    }
    
    .top-navbar-center {
        flex: 1;
        max-width: none;
        margin: 0 8px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .top-navbar-right {
        gap: 8px;
        flex-shrink: 0;
        padding-right: 4px;
    }
    
    /* AI Search Bar - Larger on mobile for better touch target */
    .ai-search-bar {
        height: 48px;
        padding: 0 14px;
        max-width: 100%;
        width: 100%;
    }
    
    .ai-search-input {
        font-size: 1em;
        font-size: 16px; /* Prevent iOS zoom */
    }
    
    .search-clear-btn {
        width: 20px;
        height: 20px;
    }
    
    .search-clear-btn .material-symbols-outlined {
        font-size: 1em;
    }
    
    /* Hide user role on mobile */
    .top-user-info {
        display: none;
    }
    
    .top-user-avatar {
        width: 44px;
        height: 44px;
    }
    
    .top-user-avatar .material-symbols-outlined {
        font-size: 44px;
    }
    
    /* Sidebar adjustments for mobile with top nav */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1003;
        top: 0;
        height: 100vh;
    }
    
    .sidebar-header {
        display: flex !important; /* Show header on mobile */
        padding: 0;
        padding-left: 20px;
        height: 60px;
        align-items: center;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .sidebar-header h2 {
        display: block !important;
        font-size: 1.3em;
        font-weight: 700;
        color: #1f2937;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    }
    
    /* Main content adjustments */
    .main-content {
        margin-left: 0 !important;
        margin-top: 60px;
        padding: 8px;
    }
    
    .main-content.sidebar-collapsed {
        margin-left: 0;
    }
}

/* Small Mobile - Compact top nav */
@media (max-width: 480px) {
    .top-navbar {
        padding: 0 8px;
        gap: 6px;
    }
    
    .top-navbar-left {
        gap: 6px;
    }
    
    .top-navbar-center {
        margin: 0 6px;
        flex: 1;
        max-width: none;
    }
    
    .top-logo {
        display: none !important; /* Hide logo on mobile - shown in sidebar instead */
    }
    
    .logo-icon {
        font-size: 1.2em;
    }
    
    .logo-text {
        font-size: 0.9em;
    }
    
    /* AI Search Bar - Even more compact and flexible */
    .ai-search-bar {
        height: 36px;
        padding: 0 10px;
        min-width: 100px;
        width: 100%;
    }
    
    .ai-search-input {
        font-size: 14px;
    }
    
    .ai-search-input::placeholder {
        font-size: 13px;
    }
    
    .top-nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .top-user-avatar {
        width: 32px;
        height: 32px;
    }
    
    .top-user-avatar .material-symbols-outlined {
        font-size: 32px;
    }
    
    .top-user-menu {
        padding: 4px 6px;
    }
    
    /* Filters - Phone - Larger touch targets */
    .filters {
        padding: 12px !important;
        gap: 8px !important;
    }
    
    .filter-buttons {
        gap: 8px !important;
        row-gap: 8px !important;
        padding-bottom: 8px !important;
    }
    
    .filter-btn {
        font-size: 0.8em !important;
        padding: 9px 14px !important;
    }
    
    /* Filter Controls - Phone - Larger and more spacing */
    .filter-controls {
        gap: 8px !important;
        padding-bottom: 0 !important;
        flex-wrap: wrap !important;
    }
    
    .filter-group {
        gap: 6px !important;
        white-space: nowrap !important;
    }
    
    .filter-label {
        font-size: 0.75em !important;
        white-space: nowrap !important;
    }
    
    .filter-select {
        font-size: 0.75em !important;
        padding: 7px 9px !important;
        min-width: auto !important;
    }
    
    .auto-refresh-toggle {
        font-size: 0.8em !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }
    
    .auto-refresh-toggle label {
        gap: 5px !important;
        white-space: nowrap !important;
    }
    
    .auto-refresh-toggle input[type="checkbox"] {
        width: 15px !important;
        height: 15px !important;
        flex-shrink: 0 !important;
    }
    
    .refresh-interval-select {
        font-size: 0.8em !important;
        padding: 6px 8px !important;
        min-width: auto !important;
    }
    
    .custom-interval-input {
        width: 55px !important;
        font-size: 0.8em !important;
        padding: 6px 8px !important;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================================================
   AI CHATBOT MODAL
   ============================================================================ */

.ai-chat-modal {
    position: fixed;
    top: 60px; /* Below top navbar */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002; /* Above top navbar */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ai-chat-modal.active {
    display: flex;
}

.ai-chat-container {
    background: white;
    border-radius: 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 100px); /* Account for top navbar + padding */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-title .material-symbols-outlined {
    font-size: 1.5em;
    color: #3b82f6;
}

.ai-chat-title h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #1f2937;
}

.ai-chat-close {
    background: #f3f4f6;
    border: none;
    color: #6b7280;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-chat-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.ai-chat-close .material-symbols-outlined {
    font-size: 1.3em;
}

.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: white;
}

.ai-message,
.user-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.user-message {
    flex-direction: row-reverse;
}

.ai-message .material-symbols-outlined,
.user-message .material-symbols-outlined {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3em;
}

.ai-message .material-symbols-outlined {
    background: #dbeafe;
    color: #3b82f6;
}

.user-message .material-symbols-outlined {
    background: #e5e7eb;
    color: #6b7280;
}

.message-content {
    background: #f9fafb;
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 80%;
}

.user-message .message-content {
    background: #3b82f6;
    color: white;
}

.message-content p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

.ai-chat-input-container {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 20px; /* Pill-shaped like top search bar */
    font-size: 0.95em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.2s ease;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ai-chat-send {
    background: #3b82f6;
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%; /* Circular button */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-chat-send:hover {
    background: #2563eb;
}

.ai-chat-send:active {
    transform: scale(0.95);
}

.ai-chat-send .material-symbols-outlined {
    font-size: 1.2em;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ai-chat-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .ai-chat-container {
        max-height: calc(100vh - 80px); /* More space for top navbar on mobile */
        max-width: 100%;
    }
    
    .ai-chat-header {
        padding: 16px;
    }
    
    .ai-chat-title h3 {
        font-size: 1em;
    }
    
    .ai-chat-messages {
        padding: 15px;
    }
    
    .message-content {
        max-width: 75%;
        font-size: 0.9em;
    }
    
    .ai-chat-input-container {
        padding: 15px;
    }
    
    .ai-chat-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .ai-chat-modal {
        padding: 8px;
        padding-top: 15px;
    }
    
    .ai-chat-container {
        max-height: calc(100vh - 75px);
        border-radius: 10px;
    }
    
    .ai-chat-header {
        padding: 12px 15px;
    }
    
    .ai-chat-title .material-symbols-outlined {
        font-size: 1.3em;
    }
    
    .ai-chat-title h3 {
        font-size: 0.95em;
    }
    
    .ai-chat-close {
        width: 28px;
        height: 28px;
    }
    
    .ai-chat-messages {
        padding: 12px;
        gap: 12px;
    }
    
    .ai-message .material-symbols-outlined,
    .user-message .material-symbols-outlined {
        width: 28px;
        height: 28px;
        font-size: 1.1em;
    }
    
    .message-content {
        max-width: 70%;
        padding: 10px 14px;
        font-size: 0.85em;
    }
    
    .ai-chat-input-container {
        padding: 12px;
        gap: 8px;
    }
    
    .ai-chat-send {
        width: 40px;
        height: 40px;
    }
}

/* Sticky table header with shadow on scroll */
.table-responsive {
    position: relative;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    -webkit-overflow-scrolling: touch;
}

.data-table thead::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.table-responsive.scrolled .data-table thead::after {
    opacity: 1;
}

/* ============================================================================
   DEPLOYMENT STATISTICS SECTION
   ============================================================================ */

.deployment-stats-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    position: relative;
}

.stats-header h3 {
    font-size: 1.4em;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-header h3 .material-symbols-outlined {
    font-size: 1.2em;
    color: #3b82f6;
}

.stats-period-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stats-period-select {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #6b7280;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
    height: 38px;
}

.stats-period-select:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.stats-period-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.stats-custom-dates {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-custom-dates input[type="date"] {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    font-size: 0.85em;
    color: #6b7280;
}

.stats-custom-dates span {
    color: #9ca3af;
    font-size: 0.85em;
}

.stats-apply-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-apply-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.stats-content {
    min-height: 200px;
}

/* Overview period selector container */
.overview-period-selector-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    margin-bottom: 15px;
}

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

.stats-chart-container {
    margin-top: 30px;
    padding: 20px;
    border-radius: 12px;
    position: relative;
}

.stats-chart-container .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
    flex-wrap: wrap;
}

.stats-chart-container .chart-header h4 {
    margin-bottom: 0;
}

.stats-chart-container h4 {
    font-size: 1.1em;
    color: #1f2937;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-chart-container h4 .material-symbols-outlined {
    color: #3b82f6;
}

/* Performance Timeline Grid (2x2 layout for domain charts) */
.performance-timeline-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.performance-timeline-grid .stats-chart-container {
    margin-top: 0;
    background: white;
    border: none;
    box-shadow: none;
}

.performance-timeline-grid .stats-chart-container h5 {
    font-size: 1em;
    color: #374151;
    margin-bottom: 15px;
    font-weight: 600;
}

.performance-timeline-grid .stats-chart-container canvas {
    max-height: 300px;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .performance-timeline-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
    }
    
    .performance-timeline-grid .stats-chart-container {
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 20px;
    }
    
    .performance-timeline-grid .stats-chart-container canvas {
        width: 100% !important;
    }
    
    .performance-timeline-grid .stats-chart-container h5 {
        font-size: 1.1em;
    }
}

#statsChart {
    max-height: 300px;
}

.stats-chart {
    max-height: 400px;
}

/* Mobile responsive for stats section */
@media (max-width: 768px) {
    .deployment-stats-section {
        padding: 15px;
    }

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

    .stats-period-selector {
        width: 100%;
        justify-content: flex-start;
    }

    .stats-period-select {
        width: 100%;
    }

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

    .stats-chart-container {
        padding: 15px;
    }

    .overview-period-selector-container {
        justify-content: flex-start;
        margin-top: 15px;
    }
}

/* Deployment stage cards */
.deployment-stage-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.deployment-stage-card h4 {
    font-size: 0.95em;
    color: #1f2937;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.deployment-stage-card .stage-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.deployment-stage-card .stage-status.success {
    color: #10b981;
}

.deployment-stage-card .stage-status.pending {
    color: #f59e0b;
}

.deployment-stage-card .stage-status.failed {
    color: #ef4444;
}

.deployment-stage-card .stage-detail {
    font-size: 0.85em;
    color: #6b7280;
    margin-top: 5px;
}

/* Performance and Analytics Cards */
.performance-card,
.analytics-card {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.performance-card h4,
.analytics-card h4 {
    font-size: 0.95em;
    color: #1f2937;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.performance-card .metric-row,
.analytics-card .metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.performance-card .metric-row:last-child,
.analytics-card .metric-row:last-child {
    border-bottom: none;
}

.performance-card .metric-label,
.analytics-card .metric-label {
    font-size: 0.85em;
    color: #6b7280;
}

.performance-card .metric-value,
.analytics-card .metric-value {
    font-size: 0.9em;
    font-weight: 600;
    color: #1f2937;
}

/* Info and Error Messages */
.info-message {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.info-message .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.info-message p {
    font-size: 1.1em;
    margin: 0;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.error-message strong {
    color: #dc2626;
    display: block;
    margin-bottom: 8px;
}

.error-message p {
    color: #7f1d1d;
    margin: 0;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

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

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

/* Print Styles */
@media print {
    .sidebar,
    .top-navbar,
    .filters,
    .footer,
    button {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .deployment-card {
        page-break-inside: avoid;
    }
}

/* ============================================================================
   TOOLTIPS & INFO ICONS (NEW FEATURE - November 2025)
   ============================================================================ */

.info-tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 6px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

.info-icon:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.info-tooltip {
    position: absolute;
    top: 60px;
    left: 5px;
    right: 5px;
    
    /* Modern styling to match page design */
    background: white;
    color: #1f2937;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    
    font-size: 13px;
    line-height: 1.7;
    width: auto;
    max-width: 700px;
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    white-space: normal;
    text-align: left;
    pointer-events: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.info-tooltip.show {
    opacity: 1;
    visibility: visible;
    top: 55px;
    pointer-events: auto;
}

/* Tooltip arrow - pointing upward, styled to match */
.info-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 40px;
    border: 8px solid transparent;
    border-bottom-color: white;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.05));
}

/* Subtle border arrow for depth */
.info-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 40px;
    border: 9px solid transparent;
    border-bottom-color: #e5e7eb;
    z-index: -1;
}

/* Tooltip for stat cards */
.stat-card .label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
}

.stat-card .label .info-tooltip-container {
    margin-left: 4px;
}

.stat-card .label .info-icon {
    width: 16px;
    height: 16px;
    font-size: 11px;
}

.stat-card .label .info-tooltip {
    min-width: 280px;
    max-width: 380px;
}

/* Tooltip for chart titles */
.stats-chart-container h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.stats-chart-container h4 .chart-title-text {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    cursor: pointer;
}

.stats-chart-container h4 .info-tooltip-container {
    margin-left: auto;
}

.stats-chart-container h4 .info-icon {
    width: 20px;
    height: 20px;
    font-size: 13px;
}

/* Tooltip content styling - updated for light theme */
.tooltip-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 15px;
    color: #1f2937;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

.tooltip-content {
    font-weight: 400;
    color: #4b5563;
    margin-bottom: 10px;
    line-height: 1.6;
}

.tooltip-formula {
    margin-top: 12px;
    padding: 12px 14px;
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    line-height: 1.8;
    color: #1e40af;
}

.tooltip-formula strong {
    color: #1f2937;
    font-weight: 600;
}

.tooltip-example {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .info-tooltip {
        /* Left-aligned with margins */
        position: absolute;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        font-size: 12px;
        padding: 14px 16px;
    }
    
    /* Keep tooltip left-aligned when shown */
    .info-tooltip.show {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
    
    /* Arrow stays on left - white to match new design */
    .info-tooltip::after {
        left: 30px !important;
        right: auto;
        bottom: 100%;
        top: auto;
        border-bottom-color: white !important;
        border-top-color: transparent;
    }
    
    /* Border arrow for mobile */
    .info-tooltip::before {
        left: 30px !important;
        bottom: 100%;
        border-bottom-color: #e5e7eb !important;
    }
    
    .stat-card .label .info-tooltip {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
    
    /* Header tooltip on mobile - ensure it fits */
    .stats-header h3 .info-tooltip {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
    
    .stats-header h3 .info-tooltip.show {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
    
    /* Chart title tooltips - left aligned */
    .stats-chart-container h4 .info-tooltip {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
    
    .stats-chart-container h4 .info-tooltip.show {
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
    
    /* Adjust tooltip arrow on mobile - white to match new design */
    .stats-header h3 .info-tooltip::after,
    .stats-chart-container h4 .info-tooltip::after {
        left: 30px !important;
        right: auto;
        bottom: 100%;
        top: auto;
        border-bottom-color: white !important;
        border-top-color: transparent;
    }
    
    /* Border arrow for mobile charts */
    .stats-header h3 .info-tooltip::before,
    .stats-chart-container h4 .info-tooltip::before {
        left: 30px !important;
        border-bottom-color: #e5e7eb !important;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .info-tooltip {
        left: 5px;
        right: 5px;
        max-width: 700px;
    }
}

/* Animation for tooltip show/hide */
@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.info-tooltip.show {
    animation: tooltipFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip for section headers - HOVER TRIGGER */
.stats-header h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    cursor: pointer;
}

/* Make the entire h3 hoverable for tooltip */
.stats-header h3:hover .info-tooltip {
    opacity: 1;
    visibility: visible;
    top: 55px;
    pointer-events: auto;
}

/* Chart titles - HOVER TRIGGER - only on text, not entire h4 */
.stats-chart-container h4 {
    position: relative;
}

.stats-chart-container h4 .chart-title-text:hover .info-tooltip {
    opacity: 1;
    visibility: visible;
    top: 55px;
    pointer-events: auto;
}

/* ============================================================================
   AGGREGATE PERFORMANCE STYLES
   ============================================================================ */

/* Stats Table */
.stats-table-container {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stats-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.stats-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.stats-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s ease;
}

.stats-table tbody tr:hover {
    background: #f9fafb;
}

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

.stats-table td {
    padding: 14px 12px;
    font-size: 14px;
    color: #374151;
}

.stats-table td a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.stats-table td a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.stats-table td strong {
    color: #1f2937;
    font-weight: 600;
}

/* Rank Badge */
.rank-badge {
    display: inline-block;
    background: #e5e7eb;
    color: #6b7280;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.rank-badge.top-rank {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
}

/* Domain Link */
.domain-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.domain-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Sublabel for stat cards */
.stat-card .sublabel {
    font-size: 0.75em;
    color: rgba(0, 0, 0, 0.5);
    margin-top: 4px;
    font-weight: 400;
}

/* ============================================================================
   AGGREGATE PERFORMANCE SECTION (NEW - Phase 1)
   ============================================================================ */

.aggregate-info {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.info-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.info-badge .material-symbols-outlined {
    font-size: 20px;
}

.info-badge strong {
    font-weight: 600;
}

/* Metrics Grid for Aggregate Performance */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.metric-card {
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    min-height: 120px;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.metric-card:nth-child(1) {
    background: linear-gradient(135deg, #dbeafe 0%, white 100%);
}

.metric-card:nth-child(2) {
    background: linear-gradient(135deg, #ede9fe 0%, white 100%);
}

.metric-card:nth-child(3) {
    background: linear-gradient(135deg, #d1fae5 0%, white 100%);
}

.metric-card:nth-child(4) {
    background: linear-gradient(135deg, #fef3c7 0%, white 100%);
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-card:nth-child(1) .metric-icon {
    color: #3b82f6;
}

.metric-card:nth-child(2) .metric-icon {
    color: #8b5cf6;
}

.metric-card:nth-child(3) .metric-icon {
    color: #10b981;
}

.metric-card:nth-child(4) .metric-icon {
    color: #f59e0b;
}

.metric-icon .material-symbols-outlined {
    font-size: 32px;
}

.metric-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-label {
    font-size: 0.9em;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 2.2em;
    font-weight: 700;
    line-height: 1.2;
}

.metric-card:nth-child(1) .metric-value {
    color: #3b82f6;
}

.metric-card:nth-child(2) .metric-value {
    color: #8b5cf6;
}

.metric-card:nth-child(3) .metric-value {
    color: #10b981;
}

.metric-card:nth-child(4) .metric-value {
    color: #f59e0b;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    min-height: 200px;
}

.empty-state .material-symbols-outlined {
    font-size: 64px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state small {
    font-size: 14px;
    color: #9ca3af;
}

/* Error Message with Retry */
.error-message .retry-btn {
    margin-top: 16px;
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.error-message .retry-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.error-message .retry-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Data Table Styling */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.data-table thead {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #6b21a8;
}

.data-table thead tr:first-child th:first-child {
    border-top-left-radius: 8px;
}

.data-table thead tr:first-child th:last-child {
    border-top-right-radius: 8px;
}

.data-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

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

.data-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.data-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.data-table td {
    padding: 14px 12px;
    font-size: 14px;
    color: #374151;
}

.data-table td a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.data-table td a:hover {
    color: #2563eb;
    text-decoration: underline;
}

.data-table td strong {
    color: #1f2937;
    font-weight: 600;
}

/* Stats Section Headers */
.stats-section h4 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-section h4 .material-symbols-outlined {
    font-size: 24px;
    color: #667eea;
}

/* Chart Container for Aggregate */
.stats-chart-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
}

.stats-chart-container h4 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.stats-chart-container canvas {
    max-height: 400px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .aggregate-info {
        flex-direction: column;
    }
    
    .metric-card {
        padding: 20px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .table-responsive {
        font-size: 13px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-responsive table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
    
    /* Aggregate Performance by Dimension - Mobile Optimizations */
    .performance-tables-wrapper {
        padding: 0;
    }
    
    .performance-tabs-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 12px 10px;
        margin: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .performance-tabs-nav::-webkit-scrollbar {
        display: none;
    }
    
    .performance-tabs-nav .perf-tab {
        font-size: 13px;
        padding: 10px 16px;
        white-space: nowrap;
        min-width: auto;
    }
    
    .dimension-table-container {
        padding: 15px 10px;
    }
    
    .dimension-table-header {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .dimension-table-wrapper {
        max-height: 400px;
        font-size: 13px;
    }
    
    .dimension-table {
        font-size: 0.85em;
        min-width: 600px;
    }
    
    .dimension-table th {
        padding: 10px 8px;
        font-size: 0.85em;
    }
    
    .dimension-table td {
        padding: 10px 8px;
        font-size: 0.85em;
    }
    
    .dimension-table .col-dimension {
        width: 35%;
        max-width: 200px;
    }
    
    .dimension-table .col-clicks,
    .dimension-table .col-impressions,
    .dimension-table .col-ctr,
    .dimension-table .col-position {
        width: 16%;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile - iPhone SE, etc */
    .performance-tabs-nav {
        padding: 10px 5px;
    }
    
    .performance-tabs-nav .perf-tab {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .dimension-table-container {
        padding: 10px 5px;
    }
    
    .dimension-table-wrapper {
        max-height: 350px;
        font-size: 12px;
    }
    
    .dimension-table {
        font-size: 0.8em;
        min-width: 550px;
    }
    
    .dimension-table th {
        padding: 8px 6px;
        font-size: 0.8em;
    }
    
    .dimension-table td {
        padding: 8px 6px;
        font-size: 0.8em;
    }
    
    .dimension-table .col-dimension {
        width: 30%;
        max-width: 150px;
    }
    
    .dimension-table td.col-dimension {
        font-size: 0.85em;
    }
}
