/**
 * Multi-Tyre Comparison Styles
 */

/* ========================================
   Page Header
   ======================================== */
.mc-page-header {
    border-radius: 12px;
    border: none;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.mc-page-header__title-bar {
    padding: 24px 28px 8px;
}

.mc-page-header__title {
    /* Reset global h1 styles */
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    /* Card-specific styles */
    color: #1a1a2e;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.mc-page-header__meta {
    display: flex;
    align-items: center;
    padding: 16px 28px;
    gap: 16px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.mc-page-header__stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #64748b;
}

.mc-page-header__stat i {
    color: var(--tyre-reviews-blue, #0db1e7);
}

@media (max-width: 768px) {
    .mc-page-header__title-bar {
        padding: 16px 16px 6px;
    }

    .mc-page-header__title {
        font-size: 1.25rem;
    }

    .mc-page-header__meta {
        padding: 12px 16px;
        gap: 12px;
    }

    .mc-page-header__stat {
        font-size: 0.82rem;
    }
}

/* ========================================
   Section Cards
   ======================================== */
.mc-section {
    border-radius: 12px;
    border: none;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: 24px 28px;
}

.mc-section__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-section__title i {
    color: var(--tyre-reviews-blue, #0db1e7);
}

/* Remove padding when section wraps rg-weights (which has its own padding+border) */
.mc-section--flush {
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .mc-section {
        padding: 16px;
        border-radius: 8px;
    }

    .mc-section--flush {
        padding: 0;
    }
}

/* ========================================
   Tyre Overview Cards (top of page)
   ======================================== */
.mc-tyre-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 1.5rem;
}

.mc-tyre-card {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 16px;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.mc-tyre-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.mc-tyre-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.mc-tyre-card__image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.mc-tyre-card__image img {
    object-fit: contain;
    height: 100%;
    width: 100%;
    border-radius: 6px;
    background: #f8fafc;
    padding: 4px;
}

.mc-tyre-card__name {
    font-weight: 600;
    font-size: 0.92rem;
    color: #1a1a2e;
    text-decoration: none;
    line-height: 1.3;
}

.mc-tyre-card__name:hover {
    color: var(--tyre-reviews-blue, #0db1e7);
}

.mc-tyre-card__meta {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Score circle — logo with overlaid score */
.mc-tyre-card__score {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
}

.mc-tyre-card__score-circle {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-tyre-card__score-circle img {
    width: 100%;
    height: 100%;
    display: block;
}

.mc-tyre-card__score-value {
    position: absolute;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.mc-tyre-card__score-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #555;
    line-height: 1.2;
}

.mc-tyre-card__score-label span {
    display: block;
    font-size: 0.68rem;
    font-weight: 400;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
}

.mc-tyre-card__stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    font-size: 0.78rem;
    color: #64748b;
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

.mc-tyre-card__stats dt {
    font-weight: 600;
    color: #334155;
}

.mc-tyre-card__stats dd {
    margin: 0;
}

/* ========================================
   W/D/L Collapsible
   ======================================== */
.mc-wdl-toggle {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    padding: 12px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-wdl-toggle::-webkit-details-marker {
    display: none;
}

.mc-wdl-toggle::before {
    content: "\f0da";
    font-family: FontAwesome;
    transition: transform 0.2s ease;
    color: var(--tyre-reviews-blue, #0db1e7);
}

details[open] > .mc-wdl-toggle::before {
    transform: rotate(90deg);
}

/* ========================================
   Tests Included List
   ======================================== */
.mc-tests-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mc-tests-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-tests-list li:last-child {
    border-bottom: none;
}

.mc-tests-list li::before {
    content: "\f0da";
    font-family: FontAwesome;
    color: var(--tyre-reviews-blue, #0db1e7);
    font-size: 0.85rem;
}

.mc-tests-list a {
    font-weight: 500;
    color: #1a1a2e;
    text-decoration: none;
}

.mc-tests-list a:hover {
    color: var(--tyre-reviews-blue, #0db1e7);
}

/* Selector page */
#tyre-search {
    font-size: 1.1rem;
}

#search-results {
    position: absolute;
    z-index: 1000;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 0.375rem;
}

#search-results .list-group-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#search-results .list-group-item:hover,
#search-results .list-group-item.active {
    background-color: #f8f9fa;
}

#search-results .list-group-item img {
    flex-shrink: 0;
}

/* Selected tyre chips */
#tyre-chips {
    min-height: 40px;
}

#tyre-chips .badge {
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#tyre-chips .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#tyre-chips .btn-close {
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

#tyre-chips .btn-close:hover {
    opacity: 1;
}

/* Comparison page */
.multi-compare-leaderboard .table {
    margin-bottom: 0;
}

.multi-compare-leaderboard .badge {
    min-width: 2rem;
}

/* Spider chart container */
.spider-chart-container {
    min-height: 300px;
}

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

/* Category breakdown cards */
.multi-compare-breakdown .card {
    transition: box-shadow 0.2s ease;
}

.multi-compare-breakdown .card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.multi-compare-breakdown .progress {
    border-radius: 0.25rem;
    overflow: hidden;
}

.multi-compare-breakdown .progress-bar {
    transition: width 0.5s ease;
}

/* Tests list */
.multi-compare-tests .list-group-item {
    border-left: 3px solid transparent;
    transition: border-color 0.15s ease;
}

.multi-compare-tests .list-group-item:hover {
    border-left-color: #0d6efd;
}

/* Loading states */
#compare-btn .spinner-border {
    width: 1rem;
    height: 1rem;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    #tyre-chips .badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem !important;
    }

    #search-results {
        max-height: 300px;
    }

    .multi-compare-breakdown .card-body {
        padding: 0.75rem;
    }
}

/* Animation for adding tyres */
@keyframes chipAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#tyre-chips .badge {
    animation: chipAppear 0.2s ease-out;
}

/* Info alerts */
#compatibility-info {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* How it works sidebar */
.card.bg-light ul {
    padding-left: 1.2rem;
}

.card.bg-light li {
    margin-bottom: 0.5rem;
}

.card.bg-light li:last-child {
    margin-bottom: 0;
}

/* Suggestions panel */
#suggestions-panel {
    border: 1px solid #dee2e6;
}

#suggestions-panel .suggestion-item {
    transition: all 0.15s ease;
    background: #fff;
}

#suggestions-panel .suggestion-item:hover {
    background: #e9ecef;
    border-color: #0d6efd !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#suggestions-panel .suggestion-item .badge {
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

#suggestions-panel .suggestion-item:hover .badge {
    opacity: 1;
}

@media (max-width: 768px) {
    #suggestions-panel .col-md-6 {
        padding: 0.25rem;
    }

    #suggestions-panel .suggestion-item {
        padding: 0.5rem !important;
    }
}

/* Weighted Leaderboard */
#mc-weighted-leaderboard .mc-rank {
    font-weight: 700;
    width: 50px;
    text-align: center;
}

#mc-weighted-leaderboard .mc-total {
    font-weight: 700;
    white-space: nowrap;
}

#mc-weighted-leaderboard .mc-group {
    text-align: center;
    font-size: 0.85rem;
}

#mc-weighted-leaderboard .mc-group-hdr {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
}

#mc-weighted-leaderboard tr {
    transition: background-color 0.2s;
}

@media (max-width: 576px) {
    #mc-weighted-leaderboard .mc-group-hdr {
        font-size: 0.72rem;
    }

    #mc-weighted-leaderboard .mc-group {
        font-size: 0.75rem;
    }
}
