/* ============================================
   PMS REPROGRAMMATION - Dark Theme Catalog
   Pontarlier Motorsport
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --pms-bg-primary: #0a0d1a;
    --pms-bg-card: #111527;
    --pms-bg-card-hover: #161b30;
    --pms-bg-tertiary: #1c2340;
    --pms-accent: #00aaff;
    --pms-accent-glow: rgba(0, 170, 255, 0.3);
    --pms-btn: #1a3093;
    --pms-btn-hover: #2a47c9;
    --pms-text: #e8eaf0;
    --pms-text-muted: #8b90a8;
    --pms-border: rgba(255, 255, 255, 0.08);
    --pms-border-hover: rgba(0, 170, 255, 0.3);
    --pms-radius: 12px;
    --pms-radius-lg: 20px;
    --pms-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --pms-font-heading: 'Rajdhani', sans-serif;
    --pms-font-body: 'Inter', sans-serif;
    --pms-glow: 0 0 30px rgba(26, 48, 147, 0.5);
}

/* ---------- Base ---------- */
.pms-reprog {
    background: var(--pms-bg-primary);
    color: var(--pms-text);
    font-family: var(--pms-font-body);
    padding: 120px 20px 60px;
    min-height: 100vh;
}

.pms-reprog * {
    box-sizing: border-box;
}

.pms-reprog-inner {
    max-width: 100%;
    margin: 0 auto;
}

.pms-reprog-inner.pms-boxed {
    max-width: 1200px;
}

/* ---------- Typography ---------- */
.pms-title,
.pms-section h2.pms-title {
    font-family: var(--pms-font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff !important;
    text-align: center;
    margin: 0 0 8px;
    letter-spacing: 0.5px;
}

.pms-subtitle {
    font-family: var(--pms-font-body);
    font-size: 1rem;
    color: var(--pms-text-muted);
    text-align: center;
    margin: 0 0 40px;
    font-weight: 400;
}

/* ---------- Alerts ---------- */
.pms-alert {
    padding: 16px 20px;
    border-radius: var(--pms-radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.pms-alert-warning {
    background: rgba(232, 183, 91, 0.1);
    border: 1px solid rgba(232, 183, 91, 0.3);
    color: #e8b75b;
}

/* ---------- Breadcrumb ---------- */
.pms-breadcrumb {
    padding: 12px 0 24px;
    font-size: 0.85rem;
    color: var(--pms-text-muted);
}

.pms-breadcrumb a {
    color: var(--pms-text-muted);
    text-decoration: none;
    transition: color var(--pms-transition);
}

.pms-breadcrumb a:hover {
    color: var(--pms-accent);
}

.pms-sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* ============================================
   VEHICLE TYPE SELECTION
   ============================================ */
.pms-types-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px;
}

.pms-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--pms-bg-card);
    border: 1px solid var(--pms-border);
    border-radius: var(--pms-radius-lg);
    padding: 30px 20px;
    text-decoration: none;
    color: var(--pms-text);
    transition: all var(--pms-transition);
    position: relative;
    overflow: hidden;
}

.pms-type-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity var(--pms-transition);
}

.pms-type-card:hover {
    border-color: var(--pms-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 170, 255, 0.15);
    color: #fff;
}

.pms-type-card:hover::before {
    opacity: 1;
}

.pms-type-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    color: var(--pms-accent);
    transition: transform var(--pms-transition);
    filter: drop-shadow(0 0 8px rgba(0, 170, 255, 0.2));
}

.pms-type-card:hover .pms-type-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 16px rgba(0, 170, 255, 0.5));
    color: #fff;
}

.pms-type-icon svg {
    width: 100%;
    height: 100%;
}

.pms-type-name {
    font-family: var(--pms-font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

/* ============================================
   BRAND SELECTION
   ============================================ */
.pms-brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.pms-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--pms-bg-card);
    border: 1px solid var(--pms-border);
    border-radius: var(--pms-radius);
    padding: 20px 10px;
    text-decoration: none;
    color: var(--pms-text);
    transition: all var(--pms-transition);
    min-height: 120px;
}

.pms-brand-card:hover {
    border-color: var(--pms-border-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0, 170, 255, 0.12);
    color: #fff;
}

.pms-brand-card img {
    max-width: 70px;
    max-height: 50px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: brightness(0.9);
    transition: filter var(--pms-transition);
}

.pms-brand-card:hover img {
    filter: brightness(1.1);
}

.pms-brand-card span {
    font-family: var(--pms-font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
    color: #fff;
}

/* ============================================
   NAVIGATION CARDS (Models / Years / Motors)
   ============================================ */
.pms-navigation {
    padding: 0;
}

.pms-nav-header h2 {
    font-family: var(--pms-font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff !important;
    margin: 0 0 28px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--pms-border);
}

.pms-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 380px));
    gap: 24px;
}

.pms-nav-card {
    background: var(--pms-bg-card);
    border: 1px solid var(--pms-border);
    border-radius: var(--pms-radius);
    overflow: hidden;
    transition: all var(--pms-transition);
}

.pms-nav-card:hover {
    border-color: var(--pms-border-hover);
    box-shadow: 0 4px 20px rgba(0, 170, 255, 0.08);
}

.pms-nav-card-header {
    background: var(--pms-bg-tertiary);
    border-bottom: 1px solid var(--pms-border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pms-nav-card-header h3 {
    font-family: var(--pms-font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff !important;
    margin: 0;
}

.pms-nav-card-header img {
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    padding: 4px;
}

.pms-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.pms-nav-list::-webkit-scrollbar {
    width: 4px;
}

.pms-nav-list::-webkit-scrollbar-track {
    background: var(--pms-bg-card);
}

.pms-nav-list::-webkit-scrollbar-thumb {
    background: var(--pms-btn);
    border-radius: 2px;
}

.pms-nav-list li {
    border-bottom: 1px solid var(--pms-border);
}

.pms-nav-list li:last-child {
    border-bottom: none;
}

.pms-nav-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #fff !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all var(--pms-transition);
}

.pms-nav-list li a:hover {
    background: rgba(0, 170, 255, 0.06);
    color: var(--pms-accent);
    padding-left: 24px;
}

.pms-motor-hp {
    font-family: var(--pms-font-heading);
    font-weight: 700;
    color: var(--pms-accent);
    font-size: 0.85rem;
    background: rgba(0, 170, 255, 0.1);
    padding: 2px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ---------- Fuel type grouping ---------- */
.pms-fuel-group-label {
    padding: 10px 20px 6px;
    border-bottom: 1px solid var(--pms-border);
}

.pms-fuel-badge {
    display: inline-block;
    font-family: var(--pms-font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 3px 12px;
    border-radius: 20px;
}

.pms-fuel-essence {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.pms-fuel-diesel {
    background: rgba(52, 152, 219, 0.15);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

/* ============================================
   VEHICLE DETAILS
   ============================================ */
.pms-details {
    padding: 0;
}

.pms-details-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--pms-btn);
}

.pms-type-badge {
    display: inline-block;
    background: var(--pms-btn);
    color: #fff;
    font-family: var(--pms-font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.pms-details-header h1 {
    font-family: var(--pms-font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff !important;
    margin: 0;
}


.pms-details-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
}

/* Left column: image + motors */
.pms-car-image {
    background: var(--pms-bg-card);
    border: 1px solid var(--pms-border);
    border-radius: var(--pms-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.pms-car-image img {
    width: 100%;
    height: auto;
    display: block;
}

.pms-motors-card {
    background: var(--pms-bg-card);
    border: 1px solid var(--pms-border);
    border-radius: var(--pms-radius);
    overflow: hidden;
}

.pms-motors-card h3 {
    font-family: var(--pms-font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: #fff !important;
    margin: 0;
    padding: 14px 20px;
    background: var(--pms-bg-tertiary);
    border-bottom: 1px solid var(--pms-border);
}

.pms-motors-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 350px;
    overflow-y: auto;
}

.pms-motors-list::-webkit-scrollbar {
    width: 4px;
}

.pms-motors-list::-webkit-scrollbar-thumb {
    background: var(--pms-btn);
    border-radius: 2px;
}

.pms-motors-list li {
    border-bottom: 1px solid var(--pms-border);
}

.pms-motors-list li:last-child {
    border-bottom: none;
}

.pms-motors-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    color: #fff !important;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all var(--pms-transition);
}

.pms-motors-list li a:hover {
    background: var(--pms-bg-card-hover);
    color: var(--pms-accent);
}

.pms-motor-name {
    flex: 1;
}

/* Right column: description + chart + specs + price */
.pms-description {
    color: #fff !important;
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--pms-bg-card);
    border: 1px solid var(--pms-border);
    border-radius: var(--pms-radius);
}

/* Chart */
#pms-chart-custom {
    box-sizing: border-box;
}

/* Specs table */
.pms-specs-table {
    margin-bottom: 24px;
    border-radius: var(--pms-radius);
    overflow: hidden;
    border: 1px solid var(--pms-border);
}

.pms-specs-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--pms-bg-card) !important;
}

.pms-specs-table thead th {
    background: var(--pms-bg-tertiary) !important;
    color: #fff !important;
    font-family: var(--pms-font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 18px;
    text-align: center;
    border-bottom: 1px solid var(--pms-border) !important;
    border-right: 1px solid var(--pms-border);
}

.pms-specs-table thead th:first-child {
    text-align: left;
}

.pms-specs-table thead th:last-child {
    border-right: none;
}

.pms-specs-table tbody th,
.pms-specs-table tbody tr th {
    color: #fff !important;
    background: #0f1329 !important;
    font-family: var(--pms-font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid var(--pms-border) !important;
    border-right: 1px solid var(--pms-border);
    white-space: nowrap;
}

.pms-specs-table tbody td {
    color: #fff !important;
    background: var(--pms-bg-card) !important;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 16px 18px;
    text-align: center;
    border-bottom: 1px solid var(--pms-border) !important;
    border-right: 1px solid var(--pms-border);
}

.pms-specs-table tbody td:last-child,
.pms-specs-table tbody th:last-child {
    border-right: none;
}

.pms-specs-table tbody tr:last-child th,
.pms-specs-table tbody tr:last-child td {
    border-bottom: none !important;
}

.pms-specs-table tbody td.pms-highlight {
    color: var(--pms-accent) !important;
    font-weight: 700;
}

/* Price block */
.pms-price-block {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 20px;
    padding: 20px 24px;
    background: var(--pms-bg-card);
    border: 1px solid var(--pms-border);
    border-radius: var(--pms-radius);
    margin-bottom: 24px;
}

.pms-price-ht .pms-price-value {
    font-family: var(--pms-font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--pms-text-muted);
}

.pms-price-ttc .pms-price-value {
    font-family: var(--pms-font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--pms-accent);
    text-shadow: 0 0 20px var(--pms-accent-glow);
}

.pms-price-label {
    font-size: 0.75rem;
    color: var(--pms-text-muted);
    text-transform: uppercase;
    margin-left: 4px;
    font-weight: 600;
}

/* Sub items */
.pms-sub-items {
    background: var(--pms-bg-card);
    border: 1px solid var(--pms-border);
    border-radius: var(--pms-radius);
    padding: 24px;
}

.pms-sub-items h3 {
    font-family: var(--pms-font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff !important;
    margin: 0 0 16px;
}

.pms-sub-items ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pms-sub-items li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #fff !important;
    font-size: 0.9rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--pms-border);
}

.pms-sub-items li:last-child {
    border-bottom: none;
}

.pms-sub-items li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pms-accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .pms-types-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .pms-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .pms-types-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0;
    }

    .pms-type-card {
        padding: 20px 15px;
    }

    .pms-type-icon {
        width: 60px;
        height: 60px;
    }

    .pms-title {
        font-size: 1.6rem;
    }

    .pms-nav-grid {
        grid-template-columns: 1fr;
    }

    .pms-brands-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .pms-brand-card {
        padding: 15px 8px;
        min-height: 100px;
    }

    .pms-brand-card img {
        max-width: 50px;
        max-height: 35px;
    }

    .pms-details-header h1 {
        font-size: 1.3rem;
    }

    .pms-price-block {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    #pms-chart-custom {
        height: 250px !important;
    }
}

@media (max-width: 480px) {
    .pms-reprog {
        padding: 20px 12px 40px;
    }

    .pms-types-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .pms-type-card {
        padding: 16px 10px;
        border-radius: var(--pms-radius);
    }

    .pms-type-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }

    .pms-type-name {
        font-size: 0.85rem;
    }

    .pms-specs-table thead th,
    .pms-specs-table tbody th,
    .pms-specs-table tbody td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
}
