/**
 * Benchmarks Page Styles
 * Custom styling for the advertising benchmarks page
 */

/* ============================================
   Bootstrap Color Overrides
   ============================================ */

:root {
    --bs-primary-rgb: 13, 71, 161; /* Darker blue: #0d47a1 */
}

.bg-primary {
    --bs-bg-opacity: 1;
    background-color: #0d47a1 !important; /* Darker blue */
}

.btn-primary {
    --bs-btn-bg: #0d47a1;
    --bs-btn-border-color: #0d47a1;
    --bs-btn-hover-bg: #0a3d91;
    --bs-btn-hover-border-color: #0a3d91;
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
    color: white !important;
}

.hero-section .container,
.hero-section .container .row,
.hero-section .container .col-lg-8,
.hero-section .container .col-xl-8 {
    background: transparent !important;
}

.hero-section .card {
    border-radius: 16px !important;
    background: white !important;
}

.hero-section h1 {
    color: #212529 !important;
    text-shadow: none !important;
}

.hero-section .lead {
    color: #6c757d !important;
    opacity: 1 !important;
}

.metadata-badges .badge {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   Tab Navigation
   ============================================ */

.nav-pills .nav-link {
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-pills .nav-link:not(.active) {
    background-color: #f8f9fa;
    color: #495057;
}

.nav-pills .nav-link:not(.active):hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.nav-pills .nav-link.active {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Platform Cards
   ============================================ */

.platform-card-inner {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.platform-card-inner:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

.platform-card .metric-box {
    transition: all 0.2s ease;
}

.platform-card-inner:hover .metric-box {
    background-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.platform-card .best-for .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
}

/* ============================================
   Cards and Panels
   ============================================ */

.card {
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.card-body {
    padding: 1.25rem;
}

/* ============================================
   Charts
   ============================================ */

canvas {
    max-height: 400px;
}

.btn-group .btn-check:checked + .btn {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Tables
   ============================================ */

.table {
    font-size: 0.95rem;
}

.table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ============================================
   Search and Filter
   ============================================ */

.input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d47a1;
    box-shadow: 0 0 0 0.2rem rgba(13, 71, 161, 0.25);
}

/* ============================================
   Industry Dashboard
   ============================================ */

#industryDashboard .card {
    transition: all 0.3s ease;
}

#industryDashboard .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1) !important;
}

#industryDashboard .display-6 {
    font-size: 2rem;
}

.alert-info {
    background-color: #e7f3ff;
    border-color: #b3d9ff;
    color: #004085;
}

/* ============================================
   Badges
   ============================================ */

.badge {
    padding: 6px 12px;
    font-weight: 500;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary {
    background-color: #0d47a1 !important;
    border-color: #0d47a1 !important;
}

.btn-primary:hover {
    background-color: #0a3d91 !important;
    border-color: #0a3d91 !important;
}

.btn-outline-primary {
    color: #0d47a1 !important;
    border-color: #0d47a1 !important;
}

.btn-outline-primary:hover {
    background-color: #0d47a1 !important;
    border-color: #0d47a1 !important;
    color: white !important;
}

/* ============================================
   Data Sources Section
   ============================================ */

.bg-light {
    background-color: #f8f9fa !important;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Mobile devices (320px - 575px) */
@media (max-width: 575px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .metadata-badges {
        flex-direction: column !important;
    }

    .metadata-badges .badge {
        font-size: 0.8rem;
        padding: 8px 12px;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group .btn {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .nav-pills .nav-link {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .platform-card-inner {
        margin-bottom: 1rem;
    }

    canvas {
        max-height: 300px;
    }

    .table {
        font-size: 0.85rem;
    }

    .card-body {
        padding: 1rem;
    }
}

/* Tablets (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .hero-section h1 {
        font-size: 2.25rem;
    }

    .platform-card {
        margin-bottom: 1rem;
    }
}

/* Small tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .col-md-6 .card {
        height: 100%;
    }
}

/* Desktops (992px and up) */
@media (min-width: 992px) {
    .platform-card {
        display: flex;
        flex-direction: column;
    }

    .platform-card-inner {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .platform-card-inner .card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .platform-card-inner .best-for {
        margin-top: auto;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .hero-section,
    .btn,
    .nav-pills,
    .input-group,
    .form-select,
    header,
    footer {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #000;
    }

    .platform-card-inner {
        page-break-inside: avoid;
    }

    body {
        background: white;
    }

    .table {
        page-break-inside: auto;
    }

    .table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .tab-content > .tab-pane {
        display: block !important;
        opacity: 1 !important;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-card,
.card {
    animation: fadeIn 0.5s ease-out;
}

.platform-card:nth-child(1) { animation-delay: 0.1s; }
.platform-card:nth-child(2) { animation-delay: 0.2s; }
.platform-card:nth-child(3) { animation-delay: 0.3s; }
.platform-card:nth-child(4) { animation-delay: 0.4s; }
.platform-card:nth-child(5) { animation-delay: 0.5s; }
.platform-card:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   Accessibility
   ============================================ */

.btn:focus,
.form-control:focus,
.form-select:focus,
.nav-link:focus {
    outline: 2px solid #0d47a1;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }

    .badge {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.text-capitalize {
    text-transform: capitalize;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.rounded {
    border-radius: 8px !important;
}

.fw-bold {
    font-weight: 600 !important;
}

.small {
    font-size: 0.875rem;
}
