/* ComparePV - Main Styles (based on pvindex) */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
}

/* General */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

main {
    flex: 1;
    padding-top: 1rem;
}

/* Navbar customization */
.navbar {
    padding: 0.75rem 0;
    background: #16181b !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.navbar-brand {
    font-weight: 600;
}

.navbar-brand i {
    color: var(--warning-color);
}

.navbar-nav {
    gap: 0.25rem;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

.navbar-nav .nav-link.active {
    background: rgba(13, 110, 253, 0.2);
    color: #6ea8fe !important;
}

.navbar-nav .nav-link i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.navbar-nav .nav-link:hover i,
.navbar-nav .nav-link.active i {
    opacity: 1;
}

/* Cards */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card.success { border-left-color: var(--success-color); }
.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.danger { border-left-color: var(--danger-color); }
.stat-card.info { border-left-color: var(--info-color); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Charts */
.chart-container {
    position: relative;
    height: 350px;
    margin-bottom: 1rem;
}

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

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table th {
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background-color: rgba(0,0,0,0.05);
}

.sort-arrow {
    display: inline-block;
    width: 12px;
    margin-left: 4px;
    opacity: 0.3;
}

.sort-arrow.active {
    opacity: 1;
}

/* Manufacturer Quick Filters */
.manufacturer-quick-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    border: 1px solid #dee2e6;
}

.manufacturer-logo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 1px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    height: 48px;
}

.manufacturer-logo-btn img {
    max-height: 40px;
    max-width: 90px;
    object-fit: contain;
    filter: grayscale(30%);
    opacity: 0.85;
    transition: all 0.2s ease;
}

.manufacturer-logo-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
    transform: translateY(-2px);
}

.manufacturer-logo-btn:hover img,
.manufacturer-logo-btn.active img {
    filter: grayscale(0%);
    opacity: 1;
}

.manufacturer-logo-btn.active {
    border-color: var(--primary-color);
    background: #e7f1ff;
}

/* Mobile: smaller logos */
@media (max-width: 768px) {
    .manufacturer-logo-btn {
        min-width: 60px;
        height: 36px;
        padding: 5px 8px;
    }
    .manufacturer-logo-btn img {
        max-height: 26px;
        max-width: 60px;
    }
    .manufacturer-quick-filters {
        padding: 0.75rem 1rem;
    }
}

/* Compare Bar */
#compareBar {
    background: linear-gradient(135deg, #e7f1ff 0%, #cfe2ff 100%);
    border: 1px solid #b6d4fe;
}

/* Search Dropdown */
.search-dropdown,
#searchDropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.search-dropdown.show,
#searchDropdown.show {
    display: block;
}

#searchDropdown .dropdown-item,
.search-dropdown .search-item {
    cursor: pointer;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: block;
    color: #212529;
    text-decoration: none;
}

#searchDropdown .dropdown-item:hover,
.search-dropdown .search-item:hover {
    background-color: #f8f9fa;
}

#searchDropdown .dropdown-item:last-child,
.search-dropdown .search-item:last-child {
    border-bottom: none;
}

/* Search highlight styling */
#searchDropdown .dropdown-item mark,
.search-dropdown .search-item mark {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

.search-dropdown .search-item .manufacturer {
    font-weight: 600;
    color: var(--primary-color);
}

.search-dropdown .search-item .model {
    color: #6c757d;
}

.search-dropdown .search-item .power {
    float: right;
    font-size: 0.875rem;
    color: var(--success-color);
}

/* Loading state */
.loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    min-height: 200px;
}

/* Hover Card Effect */
.hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Technology Badges */
.tech-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Panel row click */
tr.panel-row,
tr.selectable {
    cursor: pointer;
}

tr.panel-row:hover,
tr.selectable:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
}

/* Filter card */
.filter-card .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.filter-card .form-label i {
    color: #6c757d;
}

/* Filter Sidebar (for mobile) */
.filter-sidebar {
    position: sticky;
    top: 1rem;
}

@media (max-width: 768px) {
    .filter-sidebar {
        position: static;
    }
}

/* Compare highlight */
tr.selected-for-compare,
.table tbody tr.selected {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .stat-value {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    h1, .h1 {
        font-size: 1.5rem;
    }

    h2, .h2 {
        font-size: 1.25rem;
    }

    .btn {
        min-height: 44px;
    }

    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px;
    }
}

/* Toast container */
#toastContainer {
    z-index: 1100;
}

/* Footer */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #212529 0%, #1a1d21 100%) !important;
}

.footer h5,
.footer h6 {
    letter-spacing: 0.5px;
}

.footer-link {
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: #fff !important;
    padding-left: 4px;
}

.footer .btn-outline-secondary {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.footer .btn-outline-secondary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

/* Info boxes */
.info-box {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce5ff 100%);
    border: 1px solid #b8daff;
    border-radius: 8px;
    padding: 1rem;
}

/* Score badges */
.score-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.score-excellent { background: #d4edda; color: #155724; }
.score-good { background: #d1ecf1; color: #0c5460; }
.score-average { background: #fff3cd; color: #856404; }
.score-poor { background: #f8d7da; color: #721c24; }

/* Efficiency colors for search dropdowns */
.eff-excellent { color: #198754; font-weight: 600; }
.eff-good { color: #20c997; }
.eff-average { color: #6c757d; }

/* Comparison table highlights */
.better-value,
.highlight-best {
    background-color: rgba(25, 135, 84, 0.15) !important;
    font-weight: 600;
}

.highlight-worst {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

/* Page title styling */
.page-title {
    font-weight: 600;
    color: #212529;
}

.page-title i {
    color: var(--primary-color);
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

/* Score Bars */
.score-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
}

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

.score-bar .score-fill.excellent { background-color: #198754; }
.score-bar .score-fill.good { background-color: #20c997; }
.score-bar .score-fill.average { background-color: #ffc107; }
.score-bar .score-fill.poor { background-color: #dc3545; }

/* Badges */
.badge {
    font-weight: 500;
}

/* Badge Tier System */
.badge-tier-1 {
    background-color: #6B7280 !important;
    color: #fff;
}
.badge-tier-2 {
    background-color: #3B82F6 !important;
    color: #fff;
}
.badge-tier-3 {
    background-color: #10B981 !important;
    color: #fff;
}
.badge-tier-4 {
    background-color: #059669 !important;
    color: #fff;
}
.badge-tier-5 {
    background-color: #F59E0B !important;
    color: #000;
}

/* Rankings Tabs */
.rankings-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0;
}

.rankings-tabs .tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rankings-tabs .tab:hover {
    color: #212529;
    background: #f8f9fa;
}

.rankings-tabs .tab.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
}

.rankings-content {
    min-height: 400px;
}

.rankings-panel {
    display: none;
}

.rankings-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.ranking-item-full {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.ranking-item-full:last-child {
    border-bottom: none;
}

.ranking-item-full:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.ranking-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.ranking-badge.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.ranking-badge.silver {
    background: linear-gradient(135deg, #e8e8e8 0%, #c0c0c0 100%);
    color: #000;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.ranking-badge.bronze {
    background: linear-gradient(135deg, #cd9a5c 0%, #cd7f32 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-manufacturer {
    font-weight: 600;
    color: #0d6efd;
    font-size: 0.9rem;
}

.ranking-model {
    color: #495057;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-progress-container {
    flex: 0 0 200px;
    margin: 0 1.5rem;
}

.ranking-progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

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

.ranking-progress-bar.power {
    background: linear-gradient(90deg, #ffc107 0%, #ff9800 100%);
}

.ranking-progress-bar.efficiency {
    background: linear-gradient(90deg, #17a2b8 0%, #0d6efd 100%);
}

.ranking-progress-bar.overall {
    background: linear-gradient(90deg, #0d6efd 0%, #6f42c1 100%);
}

.ranking-value {
    flex-shrink: 0;
    text-align: right;
}

.ranking-value .value {
    font-weight: 700;
    font-size: 1.1rem;
}

.ranking-value .unit {
    font-size: 0.8rem;
    color: #6c757d;
}

@media (max-width: 767.98px) {
    .rankings-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rankings-tabs .tab {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .ranking-progress-container {
        display: none;
    }

    .ranking-item-full {
        padding: 0.875rem 1rem;
    }
}

/* Featured Panel Cards - Enhanced */
.featured-panel-card {
    min-height: 120px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-panel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.featured-panel-card .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.featured-panel-card .panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.featured-panel-card .mfg-logo-mini {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: #f8f9fa;
    padding: 2px;
}

.featured-panel-card .mfg-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0d6efd;
    line-height: 1.2;
}

.featured-panel-card .model-name {
    font-size: 0.9rem;
    color: #212529;
    margin-bottom: 0.5rem;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.featured-panel-card .panel-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.featured-panel-card .compare-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.9);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 10;
}

.featured-panel-card:hover .compare-btn {
    opacity: 1;
    transform: scale(1);
}

.featured-panel-card .compare-btn:hover {
    background: #0d6efd;
    transform: scale(1.1);
}

.featured-panel-card .compare-btn.added {
    background: #198754;
    opacity: 1;
    transform: scale(1);
}

/* Recent Panel Cards - Enhanced */
.recent-panel-card {
    min-height: 120px;
    position: relative;
}

.recent-panel-card .compare-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.9);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 10;
}

.recent-panel-card:hover .compare-btn {
    opacity: 1;
    transform: scale(1);
}

.recent-panel-card .compare-btn:hover {
    background: #0d6efd;
    transform: scale(1.1);
}

.recent-panel-card .compare-btn.added {
    background: #198754;
    opacity: 1;
    transform: scale(1);
}

/* Discover Section Tabs */
.discover-section .discover-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0;
}

.discover-section .discover-tabs .tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.discover-section .discover-tabs .tab:hover {
    color: #212529;
    background: #f8f9fa;
}

.discover-section .discover-tabs .tab.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
}

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

.discover-panel {
    display: none;
}

.discover-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    /* Horizontal scroll carousels for panel cards */
    .panel-carousel-container {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0.75rem;
        padding-bottom: 0.5rem;
        margin: 0 -0.5rem;
        padding: 0 0.5rem 0.5rem;
    }

    .panel-carousel-container::-webkit-scrollbar {
        height: 6px;
    }

    .panel-carousel-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .panel-carousel-container::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

    .panel-carousel-item {
        flex: 0 0 auto;
        width: 160px;
        scroll-snap-align: start;
    }

    .panel-carousel-item .card {
        min-height: 140px;
    }

    /* Sticky search bar on scroll */
    .search-hero-container {
        position: sticky;
        top: 0;
        z-index: 100;
        background: inherit;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    /* Minimum touch targets */
    .btn,
    .tab,
    .discover-tabs .tab,
    .rankings-tabs .tab {
        min-height: 44px;
    }

    .manufacturer-logo-btn {
        min-height: 44px;
    }

    /* Discover tabs mobile adjustments */
    .discover-section .discover-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .discover-section .discover-tabs .tab {
        white-space: nowrap;
        min-height: 44px;
    }
}

/* Panel Image */
.panel-image {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

/* Custom Utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Header Stats (glass style) */
.header-stats {
    margin-top: 1.5rem;
}

.header-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    position: relative;
    transition: all 0.2s ease;
}

.header-stat-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.header-stat-item.clickable {
    cursor: pointer;
}

.header-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-stat-icon i {
    font-size: 1.25rem;
}

.header-stat-content {
    flex: 1;
    min-width: 0;
}

.header-stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.header-stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-stat-help {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    cursor: help;
}

.header-stat-help:hover {
    color: rgba(255, 255, 255, 0.8);
}

.header-stat-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    text-decoration: none;
    margin-left: 0.5rem;
}

.header-stat-link:hover {
    color: #fff;
}

.header-stat-subtext {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.7;
}

@media (max-width: 767.98px) {
    .header-stat-item {
        padding: 0.5rem 0.75rem;
    }

    .header-stat-icon {
        width: 36px;
        height: 36px;
    }

    .header-stat-icon i {
        font-size: 1rem;
    }

    .header-stat-value {
        font-size: 1rem;
    }

    .header-stat-label {
        font-size: 0.65rem;
    }
}

/* Stats Page Hero */
.stats-hero {
    background: linear-gradient(135deg, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.65) 100%),
                url('/static/images/pv-bg1.webp') center/cover no-repeat;
    border-radius: 12px;
    padding: 2rem;
    color: white;
}

.stats-hero-title {
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
}

.stats-hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

@media (max-width: 767.98px) {
    .stats-hero {
        padding: 1.25rem;
    }

    .stats-hero-title {
        font-size: 1.5rem;
    }

    .stats-hero-subtitle {
        font-size: 0.875rem;
    }
}

/* Offer Compare Hero Variant */
.offer-compare-hero {
    background: linear-gradient(135deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.2) 100%),
                url('/static/images/bgs/bg-01.webp') center/cover no-repeat;
}

/* Comparison Page Panel Colors */
:root {
    --compare-panel1-color: #3B82F6;
    --compare-panel1-light: rgba(59, 130, 246, 0.1);
    --compare-panel2-color: #F59E0B;
    --compare-panel2-light: rgba(245, 158, 11, 0.1);
}

/* Winner Cell Highlighting */
.winner-cell {
    background-color: rgba(16, 185, 129, 0.15) !important;
    position: relative;
}
.winner-cell::after {
    content: '\2713';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #10B981;
    font-weight: bold;
}

/* Accordion Transitions */
.accordion-collapse {
    transition: height 0.3s ease;
}

.accordion-button {
    transition: background-color 0.2s ease;
}

/* Chart Container Sizing */
.chart-container-md {
    position: relative;
    min-height: 300px;
    width: 100%;
}

@media (max-width: 767.98px) {
    .chart-container-md {
        min-height: 250px;
    }
}

/* Touch Targets for Mobile */
@media (max-width: 767.98px) {
    .temp-scenario-btn,
    .btn-icon {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Panel Color Classes */
.panel1-text { color: var(--compare-panel1-color) !important; }
.panel2-text { color: var(--compare-panel2-color) !important; }
.panel1-bg { background-color: var(--compare-panel1-color) !important; }
.panel2-bg { background-color: var(--compare-panel2-color) !important; }
.panel1-border { border-color: var(--compare-panel1-color) !important; }
.panel2-border { border-color: var(--compare-panel2-color) !important; }

/* Panel Header Cards */
.panel-header-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.panel-header-card:hover {
    transform: translateY(-2px);
}
.panel1-card { border-color: var(--compare-panel1-color); border-width: 2px; }
.panel2-card { border-color: var(--compare-panel2-color); border-width: 2px; }

.panel-preview-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #1a1a2e;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    z-index: 0;
    opacity: 0.15;
    filter: blur(2px);
}
.panel-header-card .card-body {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 0.375rem;
}

/* Manufacturer Logo */
.manufacturer-logo-container {
    width: 64px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.manufacturer-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
/* Typography */
.manufacturer-name { font-size: 16px; font-weight: 600; }
.model-name { font-size: 14px; }

/* Power Badge */
.power-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    color: white;
    min-width: 70px;
}
.power-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.power-unit { font-size: 0.75rem; opacity: 0.9; }

/* Spec Badges Row */
.spec-badges-row {
    gap: 8px;
}
.spec-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
}
.spec-badge i {
    color: #64748b;
    font-size: 0.9rem;
}
.spec-badge .spec-label {
    color: #64748b;
    font-weight: 500;
}
.spec-badge .spec-value {
    color: #1e293b;
    font-weight: 600;
}

/* BEST SPECS Badge */
.best-value-ribbon {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    padding: 4px 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Icon Buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* Quick Compare Table */
.quick-compare-table th,
.quick-compare-table td {
    padding: 12px 16px;
}
.quick-compare-table .panel1-header { background: var(--compare-panel1-light); }
.quick-compare-table .panel2-header { background: var(--compare-panel2-light); }

/* Temperature Scenario Buttons */
.temp-scenario-btn {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 12px 16px;
    min-height: 48px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.temp-scenario-btn:hover {
    border-color: var(--compare-panel1-color);
    background: var(--compare-panel1-light);
}
.temp-scenario-btn.active {
    border-color: var(--compare-panel1-color);
    background: var(--compare-panel1-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.temp-scenario-btn .temp-value {
    font-weight: 600;
    margin-right: 8px;
}
.temp-scenario-btn .temp-label {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Recommendation Card */
#recommendationCard.winner-1 {
    background: linear-gradient(135deg, var(--compare-panel1-light) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-color: var(--compare-panel1-color);
}
#recommendationCard.winner-2 {
    background: linear-gradient(135deg, var(--compare-panel2-light) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: var(--compare-panel2-color);
}
#recommendationCard.tie {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1) 0%, rgba(108, 117, 125, 0.05) 100%);
    border-color: #6c757d;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, opacity 0.2s;
}
.back-to-top:hover {
    transform: scale(1.1);
}
.back-to-top.visible {
    display: flex;
}

/* Fade-in Animation */
.chart-fade-in {
    animation: chartFadeIn 0.5s ease-out;
}
@keyframes chartFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsive - Panel Cards */
@media (max-width: 767.98px) {
    .panel-header-card .card-body {
        padding: 16px;
    }
    .manufacturer-logo-container {
        width: 48px;
        height: 36px;
    }
    .power-badge {
        padding: 6px 10px;
        min-width: 60px;
    }
    .power-value { font-size: 1.25rem; }
    .temp-scenario-btn { min-height: 44px; padding: 10px 12px; }
}

/* Mobile Table Scroll */
@media (max-width: 767.98px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .filter-sidebar,
    footer,
    .btn,
    .section-nav,
    .back-to-top,
    .dropdown,
    #currencySelect,
    input[name="unitSystem"] {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    .accordion-collapse {
        display: block !important;
        height: auto !important;
    }

    .accordion-button::after {
        display: none;
    }

    .container {
        max-width: 100% !important;
    }

    .chart-container-md {
        min-height: 200px;
    }
}
