/*
 * Car-Search.ai — Listing Review Page Styles
 * Uses brand variables from car-search-theme.css
 */

/* =============================================
   LAYOUT
   ============================================= */
.listing-review {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* =============================================
   TOP ROW: Gallery left, Verdict right
   ============================================= */
.review-top-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

.review-top-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.review-top-left .review-gallery {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.review-top-left .review-gallery-main {
    flex: 1;
    min-height: 0;
    object-fit: cover;
    aspect-ratio: auto;
}

.review-top-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .review-top-row {
        flex-direction: column;
    }
}

/* =============================================
   HERO
   ============================================= */
.review-hero {
    margin-bottom: 2rem;
}

.review-hero h1 {
    font-size: 2rem;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.review-meta {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    font-family: 'DM Sans', sans-serif;
}

.review-meta span {
    color: var(--gold);
}

/* =============================================
   GALLERY
   ============================================= */
.review-gallery {
    margin-bottom: 2.5rem;
}

.review-gallery-main {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 12px;
    background: #1e1e1e;
    margin-bottom: 0.75rem;
}

.review-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.review-gallery-thumbs img {
    width: 100px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.review-gallery-thumbs img:hover,
.review-gallery-thumbs img.active {
    opacity: 1;
    border-color: var(--gold);
}

/* =============================================
   TABS
   ============================================= */
.review-tabs {
    margin-bottom: 1.5rem;
}

.review-tab-nav {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.review-tab-nav::-webkit-scrollbar { display: none; }

.review-tab-btn {
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255,255,255,0.45);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.review-tab-btn:hover {
    color: rgba(255,255,255,0.75);
}

.review-tab-btn.active {
    color: #EC660A;
    border-bottom-color: #EC660A;
}

.review-tab-panel {
    display: none;
    padding: 1.25rem 0 0;
}

.review-tab-panel.active {
    display: block;
}

/* =============================================
   CONTENT SECTIONS
   ============================================= */
.review-section {
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.review-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.review-section p {
    color: rgba(255,255,255,0.75);
    line-height: 1.75;
    font-size: 0.95rem;
}

/* =============================================
   SPECS TABLE
   ============================================= */
.review-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.review-spec-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
}

.review-spec-row:nth-child(odd) {
    background: rgba(255,255,255,0.02);
}

.review-spec-label {
    color: rgba(255,255,255,0.5);
    font-family: 'DM Sans', sans-serif;
}

.review-spec-value {
    color: #ffffff;
    font-weight: 500;
    text-align: right;
}

/* =============================================
   PRICE ANALYSIS
   ============================================= */
.review-price-position {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
}

.review-price-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.review-price-badge.below-market {
    background: rgba(56, 182, 163, 0.15);
    color: #38B6A3;
    border: 1px solid rgba(56, 182, 163, 0.3);
}

.review-price-badge.at-market {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.review-price-badge.above-market {
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b7a;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.review-price-summary {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}

.review-price-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

.review-price-range strong {
    color: #ffffff;
}

/* =============================================
   SCORE BADGES
   ============================================= */
.review-score-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.review-score-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 3px solid;
}

.review-score-circle.score-high {
    color: #38B6A3;
    border-color: #38B6A3;
    background: rgba(56, 182, 163, 0.1);
}

.review-score-circle.score-mid {
    color: #ffc107;
    border-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.review-score-circle.score-low {
    color: #ff6b7a;
    border-color: #ff6b7a;
    background: rgba(220, 53, 69, 0.1);
}

.review-score-details {
    flex: 1;
}

.review-score-details h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.review-score-details p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin: 0;
    line-height: 1.5;
}

/* =============================================
   SOURCE LINK
   ============================================= */
.review-source-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
}

.review-source-link:hover {
    background: rgba(236, 102, 10, 0.1);
    border-color: rgba(236, 102, 10, 0.3);
}

/* =============================================
   SIMILAR LISTINGS GRID
   ============================================= */
.review-similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.review-similar-card {
    background: #2a2a2a;
    border: 1px solid #383838;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.review-similar-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.review-similar-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #1e1e1e;
}

.review-similar-card-info {
    padding: 0.85rem;
}

.review-similar-card-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
    line-height: 1.3;
}

.review-similar-card-info .similar-price {
    color: var(--gold);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.review-similar-card-info .similar-meta {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.4;
}

/* =============================================
   CTA SECTION
   ============================================= */
.review-cta-section {
    text-align: center;
    padding: 2.5rem 2rem;
    background: linear-gradient(135deg, rgba(236,102,10,0.08), rgba(56,182,163,0.05));
    border: 1px solid rgba(236,102,10,0.15);
    border-radius: 16px;
    margin-top: 2rem;
}

.review-cta-section h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
}

.review-cta-section p {
    color: rgba(255,255,255,0.6);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.review-cta-btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    background: var(--gold);
    color: #fff !important;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.review-cta-btn:hover {
    background: var(--gold-dark);
    transform: translateY(-1px);
    color: #fff;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .listing-review {
        padding: 1.25rem 1rem 3rem;
    }

    .review-hero h1 {
        font-size: 1.45rem;
    }

    .review-specs-grid {
        grid-template-columns: 1fr;
    }

    .review-similar-grid {
        grid-template-columns: 1fr 1fr;
    }

    .review-score-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .review-similar-grid {
        grid-template-columns: 1fr;
    }

    .review-gallery-thumbs img {
        width: 72px;
        height: 48px;
    }
}

/* =============================================
   MOBILE DETAIL PAGE
   ============================================= */
.detail-mobile-nav, .detail-mobile-tabs {
    display: none;
}

.detail-mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 201;
    background: #111; border-top: 1px solid rgba(255,255,255,0.1);
    height: 50px;
}
.detail-mobile-nav-inner {
    display: flex; height: 100%;
}
.detail-mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: none; border: none; color: rgba(255,255,255,0.4); font-size: 0.6rem;
    font-family: 'DM Sans', sans-serif; text-decoration: none; gap: 2px;
}
.detail-mobile-nav a.active { color: #EC660A; }
.detail-mobile-nav a svg { width: 20px; height: 20px; }

@media (max-width: 768px) {
    .detail-mobile-nav, .detail-mobile-tabs { display: block; }

    /* Hide desktop elements */
    .landing-footer { display: none !important; }
    .landing-header .landing-nav { display: none; }

    /* Hide fixed history sidebar */
    .listing-review + aside { display: none !important; }

    /* Full width layout */
    .listing-review {
        max-width: 100% !important;
        padding: 0.75rem 0.75rem 100px !important;
    }

    /* Stack gallery and verdict */
    .review-top-row {
        flex-direction: column !important;
    }
    .review-top-left, .review-top-right {
        width: 100% !important;
    }

    /* Gallery */
    .review-gallery-main {
        aspect-ratio: 16/9 !important;
        height: auto !important;
        flex: none !important;
    }

    /* Tabs scroll horizontally */
    .review-tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }
    .review-tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.78rem;
    }

    /* Score cards stack */
    .review-top-right > div:nth-child(2) {
        flex-wrap: wrap !important;
    }

    /* CTA section */
    .review-cta-section {
        padding: 1.5rem 1rem !important;
    }

    /* Wrapper div */
    .listing-review + aside + div,
    div[style*="display:flex"][style*="max-width"] {
        flex-direction: column !important;
        padding: 0 !important;
    }
}
