:root {
    --primary-red: #c8102e;
    --primary-red-hover: #a00d24;
    --dark-navy: #0b162c;
    --dark-navy-light: #15274d;
    --light-gray: #f4f5f7;
    --white: #ffffff;
    --text-dark: #333333;
    --text-muted: #64748b;
    --green-success: #10b981;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bezier: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- 1. CORE RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { 
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; 
    background: var(--light-gray); 
    color: var(--text-dark); 
    line-height: 1.6; 
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.text-red { color: var(--primary-red); }
img { max-width: 100%; height: auto; display: block; }

/* --- 2. HEADER & NAVIGATION --- */
.site-header { 
    background: var(--white); 
    box-shadow: var(--shadow-sm); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}

.header-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 5%; 
    border-bottom: 1px solid #f1f5f9; 
    max-width: 1400px;
    margin: 0 auto;
}

.brand-logo { 
    text-decoration: none; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    line-height: 1.1; 
}

/* Navigation Logic */
.main-nav { 
    background: var(--dark-navy); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 5%; 
}

.nav-links { display: flex; list-style: none; }

.nav-links a { 
    color: var(--white); 
    text-decoration: none; 
    padding: 18px 20px; 
    font-weight: 600; 
    text-transform: uppercase; 
    font-size: 0.85rem; 
    letter-spacing: 0.5px;
    border-bottom: 3px solid transparent; 
    transition: var(--transition); 
}

.nav-links a:hover, .nav-links a.active-link { 
    background: var(--dark-navy-light); 
    border-bottom-color: var(--primary-red); 
}

.nav-phone { 
    background: var(--primary-red); 
    color: var(--white); 
    text-decoration: none; 
    padding: 18px 25px; 
    font-weight: 800; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    transition: var(--transition);
}

.nav-phone:hover { background: var(--primary-red-hover); }

/* --- 3. RESPONSIVE MOBILE NAVIGATION --- */
@media (max-width: 992px) {
    .mobile-menu-btn { 
        display: flex; 
        background: #f8fafc; 
        border: 1px solid #e2e8f0; 
        width: 45px; 
        height: 45px; 
        border-radius: 8px; 
        font-size: 1.2rem; 
        color: var(--dark-navy); 
        cursor: pointer; 
        align-items: center; 
        justify-content: center;
        transition: var(--transition);
    }
    
    .mobile-menu-btn:active { transform: scale(0.95); background: #f1f5f9; }

    .main-nav { 
        display: block; 
        position: absolute; 
        top: 100%; 
        left: 0; 
        width: 100%; 
        background: var(--dark-navy); 
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 0;
        box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    }

    .main-nav.active { 
        max-height: 600px;
        border-top: 2px solid var(--primary-red);
    }

    .nav-links { flex-direction: column; width: 100%; }
    
    .nav-links a { 
        padding: 20px; 
        border-bottom: 1px solid rgba(255,255,255,0.05); 
        font-size: 1rem;
    }

    .nav-phone { 
        width: 100%; 
        justify-content: center; 
        padding: 25px;
        font-size: 1.2rem;
    }
}

/* --- 4. GLOBAL UI COMPONENTS --- */
.btn-primary { 
    background: var(--primary-red); 
    color: var(--white); 
    padding: 16px 32px; 
    border: none; 
    border-radius: var(--radius); 
    font-weight: 800; 
    cursor: pointer; 
    text-decoration: none; 
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 10px 25px rgba(200, 16, 46, 0.3); 
    background: var(--primary-red-hover);
}

.btn-primary:active { transform: translateY(0); }

.form-control { 
    width: 100%; 
    padding: 14px 16px; 
    border: 2px solid #e2e8f0; 
    border-radius: 10px; 
    font-size: 1rem; 
    font-weight: 600;
    transition: var(--transition); 
    background: #fdfdfd; 
    outline: none; 
}

.form-control:focus { 
    border-color: var(--primary-red); 
    background: var(--white); 
    box-shadow: 0 0 0 5px rgba(200,16,46,0.05); 
}

/* --- 5. INTERACTIVE FEATURES --- */

/* Range Slider */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 40px; 
    background: transparent;
    cursor: pointer;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 28px;
    width: 28px;
    border-radius: 50%;
    background: var(--white);
    border: 4px solid var(--primary-red);
    margin-top: -10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: var(--transition);
}

input[type=range]:active::-webkit-slider-thumb {
    transform: scale(1.15);
}

/* Toast Notifications */
.system-toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--dark-navy);
    color: var(--white);
    padding: 16px 25px;
    border-radius: 8px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    transform: translateX(150%);
    transition: transform 0.4s var(--bezier);
}

.system-toast.show { transform: translateX(0); }
.system-toast.error { background: var(--primary-red); }
.system-toast.success { background: var(--green-success); }

/* --- 6. ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.animate-fade { animation: fadeIn 0.5s ease forwards; }
.shake-error { animation: shake 0.4s ease-in-out; }

/* --- 7. ADMIN INTERFACE UTILITIES --- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
}

.stat-card { text-align: center; }
.stat-value { font-size: 2rem; font-weight: 900; color: var(--dark-navy); }

.status-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    border: 1px solid;
}

/* Portfolio Slider Logic */
#baSlider { 
    touch-action: pan-y;
    user-select: none;
    -webkit-user-drag: none;
}