/* =========================================================================
   1. GLOBAL PLATFORM VARIABLES & SHARED ROOT INFRASTRUCTURE
   ========================================================================= */
:root {
    --ccv-purple-dark: #372f6a;
    --ccv-purple: #8f86ca;
    --ccv-purple-mid: #cecae8;
    --ccv-purple-light: #e6e4f3;
    --ccv-grey-dark: #5a5a5a;
    --ccv-grey-mid: #949494;
    --ccv-grey-light: #e2e2e2;
    --ccv-bg: #e1e1e1;
    --ccv-border: 1px solid #cecae8;
    --ccv-border-thick: 3px solid #cecae8;
    --ccv-shadow: 4px 4px 6px 0 rgba(0, 0, 0, 0.4);
}

html { 
    overflow-y: scroll; 
}

/* Core Resets and Typography Baselines */
body { 
    background: var(--ccv-bg); 
    color: #212529; 
    font-family: system-ui, -apple-system, sans-serif; 
}
.ccv-shell { 
    max-width: 900px; 
}

/* Form Controls & Inputs Uniform Standardization */
.form-control { 
    min-height: 46px; 
    border-color: #ced4da; 
    color: #212529 !important; 
}
.form-control:focus { 
    border-color: var(--ccv-purple); 
    box-shadow: 0 0 0 .2rem rgba(74,64,142,.14); 
}
.form-control::placeholder { 
    color: #6c757d !important; 
    opacity: 0.65 !important; 
}

/* Primary Button Architectures */
.btn-ccv { 
    background-color: var(--ccv-purple-dark); 
    color: #fff; 
    font-weight: 600; 
    border: none; 
    padding: 0.6rem 1.5rem;
    transition: all 0.2s ease-in-out;
}
.btn-ccv:hover { 
    background-color: #241e47; 
    color: #fff; 
}

/* Structural Header & Responsive Banner Presentation Layouts */
@media (min-width: 461px) {
    .header-flex-wrapper { flex-direction: row !important; align-items: center !important; justify-content: space-between !important; flex-wrap: nowrap !important; gap: 1rem !important; }
    .brand-logo-container { width: auto !important; max-width: 50% !important; text-align: left !important; }
    .banner-graphic-container { width: 100% !important; max-width: 500px !important; text-align: right !important; }
}

/* Navigation Utilities */
.top-nav { background: #fff; border: none; }
.top-nav .nav-pills { display: flex !important; width: 100% !important; }
.top-nav .nav-item-fluid { flex: 1 1 0% !important; text-align: center !important; margin: 0 1px !important; }
.top-nav .nav-link { display: block !important; width: 100% !important; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; padding-left: 0 !important; padding-right: 0 !important; text-overflow: ellipsis; overflow: hidden; color: #495057; font-weight: 600; border-radius: .5rem; }
.top-nav .nav-link:hover { color: var(--ccv-purple); background: #f1eff9; }
.top-nav .nav-link.active { color: #fff !important; background: var(--ccv-purple-dark) !important; }

@media (max-width: 460px) {
    .top-nav .nav-link { font-size: 0.78rem !important; font-weight: 500 !important; padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
}

.ccv-main-title { margin-bottom: 1.5rem; }
.ccv-main-title h1 { font-size: 1.85rem; font-weight: 850; color: var(--ccv-purple-dark); letter-spacing: -0.5px; margin-bottom: 0.25rem; }

/* Structural Content Display Cards */
.content-card { background: #fff; border: 1px solid var(--ccv-border); border-radius: .9rem; box-shadow: 0 .2rem .6rem rgba(0,0,0,.035); overflow: hidden; }
.card-heading { padding: 1.05rem 1.2rem; border-bottom: 1px solid var(--ccv-border); background: #fff; }
.card-heading h2 { font-size: 1.15rem; font-weight: 750; margin: 0; color: var(--ccv-purple-dark); }
.card-heading p { margin: .25rem 0 0; color: #6c757d; font-size: .88rem; }
.card-body-clean { padding: 1.2rem; }
.section-icon { width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .5rem; background: #f1eff9; color: var(--ccv-purple); font-weight: 800; flex: 0 0 auto; }

/* Global Information Tables, Bullet Lists, and Content Panels */
.stats-table { margin: 0; }
.stats-table thead th { color: #6c757d; background: #f8f9fa; border-bottom: 1px solid var(--ccv-border); font-size: .78rem; text-transform: uppercase; letter-spacing: .025em; font-weight: 700; }
.stats-table td, .stats-table th { padding: .72rem .8rem; vertical-align: middle; }
.stats-table tbody tr:last-child td { border-bottom: 0; }

.ccv-outer-panel { background: #fff; border: 1px solid var(--ccv-border); border-radius: .9rem; box-shadow: 0 .2rem .6rem rgba(0,0,0,.035); overflow: hidden; }
.ccv-outer-panel .content-card { background: transparent; border: none; border-bottom: 1px solid #f0edf8; border-radius: 0 !important; box-shadow: none !important; overflow: visible; }
.ccv-outer-panel .content-card:last-of-type { border-bottom: none; }

.ccv-bullet-list { padding-left: 1.25rem; list-style-type: disc; }
.ccv-bullet-list li { margin-bottom: 0.4rem; display: list-item; }

/* Return Links and Brand Footers */
.back-top { color: var(--ccv-purple); font-weight: 650; text-decoration: none; font-size: 0.78rem; opacity: 0.85; display: inline-block; padding-top: 0.6rem; padding-bottom: 0.2rem; }
.back-top:hover { text-decoration: underline; opacity: 1; }

.custom-footer a { color: var(--ccv-purple) !important; text-decoration: none; transition: color 0.15s ease-in-out; }
.custom-footer a:hover, .custom-footer a:focus { text-decoration: underline; filter: brightness(0.85); }
.custom-footer .text-muted, .custom-footer .small, .custom-footer p { color: #6c757d !important; }

@media (max-width: 575.98px) {
    .card-body-clean { padding: 1rem; }
}

/* Quick Search Hero Banner Module (Shared across Index/Selling layouts) */
.quick-check-panel { --hero-bg: url('images/hero-banner-a-mobile.webp'); background: linear-gradient(90deg, rgba(36, 30, 71, 0.98) 0%, rgba(36, 30, 71, 0.85) 35%, rgba(36, 30, 71, 0.4) 65%, rgba(0, 0, 0, 0) 100%), var(--hero-bg) no-repeat center right; background-size: cover; color: #fff; border-radius: .9rem; box-shadow: 0 .3rem .8rem rgba(0,0,0,.1); padding: 2.5rem 1.5rem !important; }
@media (min-width: 768px) { .quick-check-panel { --hero-bg: url('images/hero-banner-a.webp'); padding: 3.5rem 2.5rem !important; } }

/* Disables mouse focus collision loops on the chart tooltip layer */
svg > g:last-child > g.google-visualization-tooltip { 
    pointer-events: none !important; 
}

/* =========================================================================
   2. PAGE SPECIFIC OVERRIDES (Safely Isolated Casing Namespace)
   ========================================================================= */

/* --- INDEX HOME PAGE (`index.php` specific tweaks) --- */
.page-index .content-card:hover { transform: translateY(-2px); transition: transform 0.15s ease-in-out; }
.btn-accent { background-color: #ffdd00; color: #000; font-weight: 700; border: 1px solid #000; }
.btn-accent:hover { background-color: #e5c600; color: #000; }

/* --- INPUT PAGE (`input.php` specific tweaks) --- */
.page-input .calculator-card { border: var(--ccv-border-thick); border-radius: .9rem; background: #fff; padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--ccv-shadow); }
.page-input .btn-ccv { background: var(--ccv-purple); border-color: var(--ccv-purple); color: #fff; font-weight: 650; }
.page-input .btn-ccv:hover { background: var(--ccv-purple-dark); border-color: var(--ccv-purple-dark); }
.page-input .table-responsive table { table-layout: fixed; width: 100%; }

/* 🛠️ WIDESCREEN FLOW UPGRADE: Breaks the 900px ceiling specifically for the entry console */
.page-input .ccv-shell { 
    max-width: 1240px !important; 
}


/* --- CALCULATOR PAGE (`calculator.php` specific tweaks) --- */
@media (min-width: 768px) { .page-calculator .quick-check-panel { --hero-bg: url('images/hero-banner-a.webp'); padding: 3.5rem 2.5rem !important; } }

/* --- STATISTICS PAGE (`statistics.php` specific tweaks) --- */
.page-statistics .stat-card { background: #fff; border: 1px solid var(--ccv-border); border-radius: .9rem; box-shadow: 0 .2rem .6rem rgba(0,0,0,.035); height: 100%; padding: 1.2rem; }
.page-statistics .stat-label { color: #6c757d; font-size: .84rem; font-weight: 650; text-transform: uppercase; letter-spacing: .025em; }
.page-statistics .stat-number { color: var(--ccv-purple-dark); font-size: clamp(1.65rem, 5vw, 2.25rem); line-height: 1.1; font-weight: 850; margin: .3rem 0 .5rem; }
.page-statistics .stat-description { color: #5a5a5a; font-size: .9rem; line-height: 1.45; margin: 0; }
.page-statistics .rank-number { color: #212529; font-variant-numeric: tabular-nums; }
.page-statistics .chart { width: 100% !important; height: 350px; padding: 0; margin: 0; }
.page-statistics .chart-note { color: #6c757d; font-size: .84rem; margin: .75rem 0 0; }

@media (max-width: 575.98px) {
    .page-statistics .chart { height: 300px; }
    .page-statistics .stats-table { font-size: .88rem; }
    .page-statistics .stats-table td, .page-statistics .stats-table th { padding: .75rem .45rem !important; }
}

/* --- BUYING PAGE (`buying.php` specific tweaks) --- */
.page-buying .btn-ccv:hover { background-color: #261e47; }

/* --- SELLING PAGE (`selling.php` specific tweaks) --- */
.page-selling .content-card:hover { 
    transform: translateY(-2px); 
    transition: transform 0.15s ease-in-out; 
}

/* 🎨 BRANDED PANEL HEADINGS: High-visibility solid full-width rows with interior margins */
.page-selling .matrix-header { 
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    color: #372f6a !important; /* Deep theme purple for crisp contrast */
    letter-spacing: 0.6px !important;
    text-transform: uppercase !important;
    margin-top: 1.75rem !important; /* Spacious block separation gap */
    margin-bottom: 0.75rem !important;
    background: #e6e4f3 !important; /* Pure pale purple panel background token fill */
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.375rem !important;
    width: 100% !important;
}

/* Reduces top spacing specifically on your first header panel */
.page-selling .matrix-header:first-of-type {
    margin-top: 0.5rem !important;
}

.page-selling .btn-accent { background-color: #ffdd00; color: #000; font-weight: 700; border: 1px solid #000; }
.page-selling .btn-accent:hover { background-color: #e5c600; color: #000; }




.admin-shell { max-width: 600px; } /* Slimmer profile optimized for a clean dashboard utility login */

