/* PCLynk Premium Custom PC Design System - Aftershock PC Style */

:root {
    --bg-primary: #0b0b0b;
    --bg-secondary: #121212;
    --bg-card: #1c1c1c;
    --bg-card-hover: #262626;
    
    --accent-red: #d12020;
    --accent-red-hover: #ff2a2a;
    --accent-red-glow: rgba(209, 32, 32, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #a8a8a8;
    --text-muted: #6c757d;
    
    --header-height: 70px;
    --max-content-width: 1440px;
    --border-color: #2b2b2b;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base Body Styles */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    padding-top: var(--header-height);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-column: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Typography & Strict Color Theme Rules:
   1. All HEADINGS -> RED (#ef4444)
   2. All text on DARK backgrounds -> PURE WHITE (#ffffff)
   3. All text on LIGHT/WHITE backgrounds -> PURE BLACK (#000000)
*/

/* 1. ALL HEADINGS ARE RED */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.card-title,
.card-header h4,
.card-header h5,
.card-header h6,
.modal-title,
.page-title,
.section-title,
.product-card-title,
.slot-name {
    color: #ef4444 !important;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* 2. ALL TEXT ON DARK BACKGROUNDS IS WHITE */
body, main, header, footer,
.navbar, .dropdown-menu,
.card, .card-body, .card-footer,
.table, .list-group-item,
.modal-content,
.bg-dark, .bg-secondary, .bg-black,
.bg-slate-950, .bg-slate-900, .bg-slate-800, .bg-slate-700,
[class*="bg-slate-"], [class*="bg-gray-8"], [class*="bg-gray-9"], [class*="bg-zinc-"] {
    color: #ffffff !important;
}

body p,
body label,
body small,
body dt, body dd,
body li,
.form-label,
.form-check-label,
.form-text,
.text-muted,
.text-secondary,
.text-slate-300,
.text-slate-400,
.text-slate-500,
.text-gray-300,
.text-gray-400,
.text-gray-500 {
    color: #ffffff !important;
}

body span:not(.badge):not(.text-danger):not(.text-emerald-400):not(.text-success):not(.text-red-500):not(.text-warning):not(.text-neon-blue):not(.text-cyan-400) {
    color: #ffffff !important;
}

.table td, .table span, .table small, .table div {
    color: #ffffff !important;
}

.table th {
    color: #ef4444 !important; /* Table headers in red */
    background-color: var(--bg-secondary) !important;
}

.form-label {
    color: #ffffff !important;
    font-weight: 600;
}

.form-text {
    color: #ffffff !important;
}

/* 3. ALL TEXT ON LIGHT/WHITE BACKGROUNDS IS BLACK */
.bg-white, .bg-light, .bg-slate-100, .bg-slate-200, .bg-gray-100, .bg-gray-200,
[class*="bg-white"], [class*="bg-light"],
.badge-light, .alert-light {
    color: #000000 !important;
}

.bg-white *, .bg-light *, .bg-slate-100 *, .bg-slate-200 *,
.bg-gray-100 *, .bg-gray-200 *,
.badge-light *, .alert-light * {
    color: #000000 !important;
}

input.bg-white, select.bg-white, textarea.bg-white {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* Navbar Tuning */
.navbar {
    height: var(--header-height);
    background-color: rgba(11, 11, 11, 0.95) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 !important;
}

.navbar-brand {
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: #ef4444 !important;
}

.navbar-nav .nav-link {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 0.5rem 1rem !important;
    color: #ffffff !important;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #ef4444 !important;
}

.navbar-nav .nav-link.text-warning {
    color: #ef4444 !important;
}

.navbar-nav .nav-link.text-warning:hover {
    color: var(--accent-red-hover) !important;
    text-shadow: 0 0 8px var(--accent-red-glow);
}

.nav-icon {
    font-size: 1.2rem;
    color: #ffffff !important;
    transition: color 0.2s ease;
}

.nav-icon:hover {
    color: #ef4444 !important;
}

/* Cards Design */
.card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-red) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-red-glow);
}

.card-header {
    background-color: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* ============================================================
   GLOBAL FORM CONTROL SYSTEM — High-Contrast Dark Theme
   Rules:
   1. Background: Deep dark (#121212 / var(--bg-secondary))
   2. Typed text: Pure white (#ffffff)
   3. Placeholder: Visible gray (#94a3b8 = slate-400, ~4.6:1 on dark)
   4. Border: Subtle dark (#2b2b2b)
   5. Focus: Vivid red ring (#d12020) + border highlight
   ============================================================ */

/* ── Base: all input-like elements ── */
.form-control,
.form-select,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea {
    background-color: var(--bg-secondary) !important; /* #121212 */
    border: 1px solid #2b2b2b !important;
    color: #ffffff !important;               /* ✅ Typed text: Pure white */
    border-radius: 4px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    caret-color: #ef4444;                    /* Red blinking cursor */
}

/* ── Placeholder text: slate-400 (#94a3b8), contrast ~4.6:1 on bg-secondary ── */
.form-control::placeholder,
.form-select::placeholder,
input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="search"]::placeholder,
input[type="tel"]::placeholder,
input[type="url"]::placeholder,
textarea::placeholder {
    color: #94a3b8 !important;   /* slate-400: clearly visible but distinct from typed text */
    opacity: 1 !important;       /* Firefox resets opacity to 0.54 by default */
    font-weight: 400;
}

/* ── Focus: vivid red outline + glow ── */
.form-control:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus {
    background-color: #1a1a1a !important;    /* Slightly lighter on focus for subtle depth */
    border-color: #d12020 !important;        /* ✅ Brand red border on focus */
    box-shadow: 0 0 0 3px rgba(209, 32, 32, 0.25), 0 0 8px rgba(209, 32, 32, 0.2) !important;
    color: #ffffff !important;
    outline: none !important;
}

/* ── Placeholder fades slightly when focused (UX polish) ── */
.form-control:focus::placeholder,
input:focus::placeholder,
textarea:focus::placeholder {
    color: #64748b !important;  /* slate-500: dims placeholder when user is typing */
    opacity: 0.8 !important;
}

/* ── Input Group Addon (icons, labels, currency symbols) ── */
.input-group-text {
    background-color: #1a1a1a !important;
    border: 1px solid #2b2b2b !important;
    color: #ffffff !important;              /* ✅ Icon text: white */
}

/* ── Small variant (form-control-sm) ── */
.form-control-sm {
    font-size: 0.82rem !important;
    padding: 0.3rem 0.6rem !important;
}

/* ── Select option dropdown items ── */
.form-select option {
    background-color: #1c1c1c !important;
    color: #ffffff !important;
}

/* ── Disabled state: clearly muted ── */
.form-control:disabled,
.form-select:disabled,
input:disabled,
textarea:disabled {
    background-color: #0b0b0b !important;
    color: #4b5563 !important;
    border-color: #1f1f1f !important;
    cursor: not-allowed;
    opacity: 0.65;
}

/* ── Readonly (e.g. cart quantity) ── */
.form-control[readonly] {
    background-color: #1a1a1a !important;
    color: #d1d5db !important;              /* gray-300 — still readable */
    border-color: #2b2b2b !important;
    cursor: default;
}

/* ── Autocomplete override (Chrome yellow autofill bg) ── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #1a1a1a inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ef4444 !important;
    border-color: #2b2b2b !important;
    transition: background-color 5000s ease-in-out 0s; /* Trick to prevent Chrome yellow flash */
}

/* ── Form check (checkboxes, radios) ── */
.form-check-input {
    background-color: var(--bg-secondary) !important;
    border-color: #4b5563 !important;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #d12020 !important;
    border-color: #d12020 !important;
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(209, 32, 32, 0.25) !important;
    border-color: #d12020 !important;
}

.form-check-label {
    color: #ffffff !important;
    cursor: pointer;
}

/* ── Form Switch (toggle) ── */
.form-switch .form-check-input {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
}

.form-switch .form-check-input:checked {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
}

/* Buttons */
.btn {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1px;
    border-radius: 4px !important;
    padding: 0.6rem 1.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--accent-red) !important;
    border: none !important;
    color: #fff !important;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--accent-red-hover) !important;
    box-shadow: 0 0 15px var(--accent-red-glow) !important;
}

.btn-outline-light {
    border: 1px solid var(--border-color) !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
}

.btn-outline-light:hover {
    background-color: #fff !important;
    color: #000 !important;
    border-color: #fff !important;
}

.btn-outline-warning {
    border: 1px solid var(--accent-red) !important;
    color: var(--accent-red) !important;
    background-color: transparent !important;
}

.btn-outline-warning:hover {
    background-color: var(--accent-red) !important;
    color: #fff !important;
    box-shadow: 0 0 12px var(--accent-red-glow) !important;
}

.btn-success {
    background-color: #198754 !important;
    border: none !important;
}

.btn-danger {
    background-color: var(--accent-red) !important;
    border: none !important;
}

/* Neon Text Accents */
.text-neon-blue {
    color: var(--accent-red) !important;
    text-shadow: 0 0 8px var(--accent-red-glow);
}

.text-neon-red {
    color: var(--accent-red) !important;
    text-shadow: 0 0 8px var(--accent-red-glow);
}

/* Container Tuning */
.max-width-container {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Layout Grid Templates */
.gaming-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.gaming-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 30px;
}

/* Footer Styling */
footer {
    background-color: #070707 !important;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.9rem;
}

.footer-link:hover {
    color: var(--accent-red);
}

.trusted-logo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.trusted-logo-grid i, .trusted-logo-grid img {
    opacity: 0.4;
    transition: opacity 0.2s ease;
    font-size: 2rem;
}

.trusted-logo-grid i:hover, .trusted-logo-grid img:hover {
    opacity: 1;
}

/* Custom CSS for Builder Index and Checkout elements */
.alert-info {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.15) !important;
    border-color: rgba(25, 135, 84, 0.4) !important;
    color: #2ec4b6 !important;
}

.alert-danger {
    background-color: rgba(209, 32, 32, 0.15) !important;
    border-color: rgba(209, 32, 32, 0.4) !important;
    color: var(--accent-red-hover) !important;
}

.badge {
    text-transform: uppercase;
    font-weight: 750;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.bg-dark {
    background-color: var(--bg-secondary) !important;
}

.table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--text-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.table td {
    color: var(--text-primary) !important;
}

.table th {
    background-color: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* PCPartPicker Row Layout Styles */
.pcpp-row {
    background-color: var(--bg-card);
    transition: background-color 0.2s ease;
}

.pcpp-row:hover {
    background-color: var(--bg-card-hover) !important;
}

.pcpp-thumb {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background-color: #fff;
    border-radius: 4px;
    padding: 4px;
}

.pcpp-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.pcpp-spec-badge {
    font-size: 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-primary);
}

.btn-pcpp-blue {
    background-color: #0074e4 !important;
    color: #fff !important;
    border: none !important;
}

.btn-pcpp-blue:hover, .btn-pcpp-blue:focus {
    background-color: #0062bd !important;
    box-shadow: 0 0 10px rgba(0, 116, 228, 0.4) !important;
}

.filter-scroll-container {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.fs-7 {
    font-size: 0.8rem;
}

.gap-x-3 {
    column-gap: 1rem;
}
.gap-y-1 {
    row-gap: 0.25rem;
}

/* Global Text Colors Overrides for Dark Theme */
.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Dark Theme List Groups */
.list-group-item {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.list-group-item-action {
    color: var(--text-primary) !important;
}

.list-group-item-action:hover, .list-group-item-action:focus {
    background-color: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
}

/* Dark Theme Modals */
.modal-content {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
}

.modal-header .btn-close {
    filter: invert(1) !important;
}

/* Custom ID-based styling for inputs, textareas, selects */
#checkout-customer-name,
#checkout-phone,
#checkout-address,
#new-offer-component-id,
#new-offer-price,
#new-offer-stock,
#catalog-create-name,
#catalog-create-brand,
#catalog-create-msrp,
#catalog-create-3d-url,
#catalog-create-cpu-socket,
#catalog-create-cpu-tdp,
#catalog-create-cpu-cores,
#catalog-create-mb-socket,
#catalog-create-mb-memory-type,
#catalog-create-mb-form-factor,
#catalog-create-mb-max-memory,
#catalog-create-ram-memory-type,
#catalog-create-ram-capacity,
#catalog-create-case-form-factors,
#catalog-create-case-max-cooler,
#catalog-create-case-max-gpu,
#catalog-create-gpu-length,
#catalog-create-gpu-psu,
#catalog-create-psu-wattage,
#propName,
#propBrand,
#propCategoryId,
#propMSRP,
#propImageUrl,
#propExternal3DModelUrl,
#propCpuSocketId,
#propCpuCoreCount,
#propCpuTDPWatt,
#propMbSocketId,
#propMbMemoryTypeId,
#propMbFormFactorId,
#propMbMaxMemoryGB,
#propRamMemoryTypeId,
#propRamCapacityGB,
#propCaseSupportedFormFactors,
#propCaseMaxCoolerHeight,
#propCaseMaxGpuLength,
#propGpuLengthMM,
#propGpuRecommendedPSUWatt,
#propPsuWattage,
#propStorageCapacityGB,
#propStorageType,
#propStorageFormFactorId,
#propStorageInterfaceId,
#propInitialPrice,
#propInitialStockQuantity {
    color: var(--text-primary) !important;
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

#checkout-customer-name:focus,
#checkout-phone:focus,
#checkout-address:focus,
#new-offer-component-id:focus,
#new-offer-price:focus,
#new-offer-stock:focus,
#catalog-create-name:focus,
#catalog-create-brand:focus,
#catalog-create-msrp:focus,
#catalog-create-3d-url:focus,
#catalog-create-cpu-socket:focus,
#catalog-create-cpu-tdp:focus,
#catalog-create-cpu-cores:focus,
#catalog-create-mb-socket:focus,
#catalog-create-mb-memory-type:focus,
#catalog-create-mb-form-factor:focus,
#catalog-create-mb-max-memory:focus,
#catalog-create-ram-memory-type:focus,
#catalog-create-ram-capacity:focus,
#catalog-create-case-form-factors:focus,
#catalog-create-case-max-cooler:focus,
#catalog-create-case-max-gpu:focus,
#catalog-create-gpu-length:focus,
#catalog-create-gpu-psu:focus,
#catalog-create-psu-wattage:focus,
#propName:focus,
#propBrand:focus,
#propCategoryId:focus,
#propMSRP:focus,
#propImageUrl:focus,
#propExternal3DModelUrl:focus,
#propCpuSocketId:focus,
#propCpuCoreCount:focus,
#propCpuTDPWatt:focus,
#propMbSocketId:focus,
#propMbMemoryTypeId:focus,
#propMbFormFactorId:focus,
#propMbMaxMemoryGB:focus,
#propRamMemoryTypeId:focus,
#propRamCapacityGB:focus,
#propCaseSupportedFormFactors:focus,
#propCaseMaxCoolerHeight:focus,
#propCaseMaxGpuLength:focus,
#propGpuLengthMM:focus,
#propGpuRecommendedPSUWatt:focus,
#propPsuWattage:focus,
#propStorageCapacityGB:focus,
#propStorageType:focus,
#propStorageFormFactorId:focus,
#propStorageInterfaceId:focus,
#propInitialPrice:focus,
#propInitialStockQuantity:focus {
    border-color: var(--accent-red) !important;
    box-shadow: 0 0 8px var(--accent-red-glow) !important;
    outline: none !important;
}

/* Custom ID-based styling for Buttons */
#checkout-submit-btn,
#new-offer-submit-btn,
#catalog-create-submit-btn,
#admin-catalog-btn-create,
#vendor-btn-new-offer {
    color: #ffffff !important;
    background-color: var(--accent-red) !important;
    border: none !important;
}

#checkout-submit-btn:hover,
#new-offer-submit-btn:hover,
#catalog-create-submit-btn:hover,
#admin-catalog-btn-create:hover,
#vendor-btn-new-offer:hover {
    background-color: var(--accent-red-hover) !important;
    box-shadow: 0 0 12px var(--accent-red-glow) !important;
}

/* Cancel / Back buttons styling */
#new-offer-cancel-btn,
#propose-cancel-btn,
#catalog-create-cancel-btn,
#admin-catalog-btn-back {
    color: var(--text-primary) !important;
    background-color: transparent !important;
    border: 1px solid var(--border-color) !important;
}

#new-offer-cancel-btn:hover,
#propose-cancel-btn:hover,
#catalog-create-cancel-btn:hover,
#admin-catalog-btn-back:hover {
    background-color: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
}

/* Specific button styles */
#vendor-btn-propose-component {
    color: var(--accent-red) !important;
    border: 1px solid var(--accent-red) !important;
    background-color: transparent !important;
}

#vendor-btn-propose-component:hover {
    background-color: var(--accent-red) !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px var(--accent-red-glow) !important;
}

#propose-submit-btn {
    color: #0b0b0b !important;
    background-color: #ffc107 !important;
    border: none !important;
}

#propose-submit-btn:hover {
    background-color: #ffca2c !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.4) !important;
}

#link-empty-shopping {
    color: var(--accent-red) !important;
    text-decoration: underline;
}

#link-empty-shopping:hover {
    color: var(--accent-red-hover) !important;
}

/* Dynamic list item and 3D link overrides */
[id^="admin-catalog-btn-3d-"] {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
}

[id^="admin-catalog-btn-3d-"]:hover {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

[id^="btn-order-detail-"] {
    color: #ffffff !important;
    background-color: var(--accent-red) !important;
    border: none !important;
}

[id^="btn-order-detail-"]:hover {
    background-color: var(--accent-red-hover) !important;
    box-shadow: 0 0 10px var(--accent-red-glow) !important;
}