/* =========================================
   GLOBAL VARIABLES
   ========================================= */
:root {
    --primary-color: #e60012;
    --dark-bg: #0f1012;
    --card-bg: #1a1c20;
    --text-light: #e0e0e0;
}

/* =========================================
   LANDING PAGE (index.php)
   ========================================= */
body.landing-body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Prevent Horizontal Overflow */
    position: relative;
    width: 100%;
}

body.landing-body section {
    border-bottom: 3px solid var(--primary-color);
}

body.landing-body h1,
body.landing-body h2,
body.landing-body h3,
body.landing-body h4,
body.landing-body h5,
body.landing-body .navbar-brand,
body.landing-body .btn-racing,
body.landing-body .footer-title {
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
}

/* Navbar */
body.landing-body .navbar {
    background-color: rgba(15, 16, 18, 0.98) !important;
    border-bottom: 1px solid #333;
    padding: 15px 0;
}

body.landing-body .navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

body.landing-body .nav-link {
    color: #aaa !important;
    font-weight: 600;
    margin: 0 5px;
    transition: 0.3s;
}

body.landing-body .nav-link.active {
    color: var(--primary-color) !important;
}

/* Fix Sticky Hover on Mobile */
@media (hover: hover) {
    body.landing-body .nav-link:hover {
        color: var(--primary-color) !important;
    }
}

body.landing-body .navbar-toggler {
    border: 2px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* Hero */
.hero-section {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), var(--dark-bg)), url('../img/bg.jpeg');
    background-size: cover;
    background-position: center;
    height: 85vh;
    display: flex;
    align-items: center;
    border-bottom: 3px solid var(--primary-color);
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    /* Responsive Font Size */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-text span {
    color: var(--primary-color);
}

/* Scrolling Wrapper */
.scrolling-wrapper::-webkit-scrollbar {
    height: 8px;
}

.scrolling-wrapper::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.scrolling-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Card Style */
.card-motor-small,
.card-service-small {
    min-width: 280px;
    max-width: 280px;
    background-color: var(--card-bg);
    border: 1px solid #333;
    border-radius: 10px;
    transition: 0.3s;
}

.card-motor-small:hover,
.card-service-small:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

/* Grid Card Style (Modal) */
.card-motor-grid {
    background-color: var(--card-bg);
    border: 1px solid #333;
    border-radius: 10px;
    transition: 0.3s;
    overflow: hidden;
    height: 100%;
}

.card-motor-grid:hover {
    border-color: var(--primary-color);
}

.img-motor-small {
    height: 160px;
    width: 100%;
    object-fit: cover;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    cursor: pointer;
}

.img-grid-cover {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid #333;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
}

.btn-racing {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 30px;
    font-weight: 700;
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0% 100%);
}

.btn-racing:hover {
    background-color: #ff7b30;
    color: white;
}

.btn-outline-racing {
    color: var(--primary-color) !important;
    border: none !important;
    background-color: transparent !important;
    font-weight: 700;
    transition: all 0.5s ease;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
    padding: 0;
    width: 20px;
    height: 20px;
    font-size: 0;
    /* Sembunyikan Teks "STAFF LOGIN" */

    /* Position relative to Navbar now */
    position: relative;
    margin-left: 30px;
    /* Jarak dari PARTS */

    border-radius: 4px;
    /* Kotak (Bukan Bulat) */
    opacity: 0.1;
    /* Masih Rahasia (Samar) */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon visibility fix since font-size is 0 */
.btn-outline-racing i {
    font-size: 14px;
    /* Icon tetap kecil */
}

.btn-outline-racing:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(230, 0, 18, 0.8);
    opacity: 1;
    transform: scale(1.2);
    width: 30px;
    height: 30px;
}


/* Responsive Secret Button */
@media (max-width: 991px) {
    .btn-outline-racing {
        margin-left: 0 !important;
        margin-top: 15px;
        /* Jarak vertikal di mobile layout */
        width: 30px;
        /* Lebih mudah ditekan di HP */
        height: 30px;
        align-self: flex-start;
        /* Rata kiri mengikuti menu lain */
        opacity: 0.15;
        /* Sedikit lebih terlihat di mobile */
    }

    .btn-outline-racing i {
        font-size: 16px;
    }
}


.table-dark-custom {
    --bs-table-bg: var(--card-bg);
    color: #ccc;
}

.table-dark-custom th {
    border-bottom: 2px solid #333;
    color: var(--primary-color);
}

.table-dark-custom td {
    border-bottom: 1px solid #333;
}

.img-sparepart {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #444;
}

/* Modal */
.modal-content {
    background-color: #ffffff;
    border: 1px solid #dfe6e9;
    color: #2d3436;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #dfe6e9;
    background-color: #f8f9fa;
    /* Light gray header */
    border-top-left-radius: calc(0.3rem - 1px);
    border-top-right-radius: calc(0.3rem - 1px);
}

.modal-footer {
    border-top: 1px solid #dfe6e9;
    background-color: #f8f9fa;
}

.btn-close {
    filter: none;
    /* Default dark cross */
}

/* Whatsapp Button */
.float-wa {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    z-index: 1000;
    text-decoration: none;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.float-wa:hover {
    background-color: #128c7e;
    color: white;
    transform: scale(1.1);
}

/* Link Show All Style */
.link-show-all {
    color: var(--text-light);
    text-decoration: none;
    transition: 0.3s;
    cursor: pointer;
}

.link-show-all:hover {
    color: var(--primary-color);
}


/* =========================================
   LOGIN PAGE (login.php)
   ========================================= */
body.login-body {
    font-family: 'Inter', sans-serif;
    background-color: var(--dark-bg);
    background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('../img/bg_motor_2t.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: hidden;
}

.login-card {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #333;
    border-top: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    position: relative;
    z-index: 2;
    color: #fff;
    /* Default text white */
}

.brand-title {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-family: 'Rajdhani', sans-serif;
}

.brand-subtitle {
    text-align: center;
    color: #aaa;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 30px;
    /* Increased spacing */
    color: #888;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.85rem;
}

.back-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.login-body .input-group-text {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #aaa;
}

.login-body .form-control {
    background-color: #222;
    border: 1px solid #444;
    color: #fff;
}

.login-body .form-control:focus {
    background-color: #222;
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(230, 0, 18, 0.25);
}

.login-body .form-label {
    color: #ccc;
    font-size: 0.9rem;
}

.btn-racing {
    width: 100%;
    /* Full width for perfect centering */
    padding: 12px;
    margin-top: 15px;
    border-radius: 6px;
    /* Smooth corners */
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* Dashboard and Print styles moved to admin.css */


/* Footer Spacing (Landing Page) */
footer {
    padding-top: 50px;
}

/* --- VISUAL UPGRADES --- */

/* 1. Parallax Hero */
.hero-section {
    background-attachment: fixed;
    /* Parallax Effect */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 2. Text Stroke Effect */
.text-stroke {
    -webkit-text-stroke: 2px #dc3545;
    color: transparent;
}

/* 3. Feature Cards (Why Choose Us) */
.bg-darker {
    background-color: #0b0c0e;
    /* Slightly darker than body */
}

.feature-card {
    background: #15171a;
    border: 1px solid #2d3436;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: #dc3545;
    box-shadow: 0 10px 30px rgba(220, 53, 69, 0.15);
}

.icon-circle {
    width: 60px;
    height: 60px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feature-card:hover .icon-circle {
    background: #dc3545;
    color: white !important;
}

/* 4. Glowing Hover Effect for Product Cards */
.glow-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-hover:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.4) !important;
    /* Red Glow */
    border-color: #dc3545 !important;
}

/* Font Adjustments */
.font-rajdhani {
    font-family: 'Rajdhani', sans-serif;
}

/* Fix for Dark Modals */
.modal-content.bg-dark .modal-header,
.modal-content.bg-dark .modal-footer {
    background-color: transparent !important;
    border-color: #6c757d !important;
}

/* =========================================
   RESPONSIVE & MOBILE OPTIMIZATION
   ========================================= */

/* Hero Text on Mobile */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2.5rem !important;
        /* Smaller title */
        line-height: 1.1;
    }

    .hero-text .lead {
        width: 100% !important;
        /* Full width paragraph */
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
        /* Smaller section headers */
        margin-bottom: 2rem;
    }
}

/* Smooth Scrolling for Touch Devices */
.scrolling-wrapper {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    /* Space for scrollbar */
}

.scrolling-wrapper>div {
    scroll-snap-align: start;
}

/* Modal Improvements for Mobile */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
        /* Reduce margin on small phones */
    }

    .img-motor-small {
        height: 140px;
        /* Slightly smaller thumbnails */
    }
}

/* Navbar Mobile Fixes */
@media (max-width: 991px) {
    body.landing-body .navbar-collapse {
        background-color: var(--dark-bg);
        padding: 1rem;
        border-radius: 0 0 10px 10px;
        border: 1px solid #333;
        border-top: none;
    }
}

/* Multi-line Text Clamp (Prevent Cut-off but keep neat) */
.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal !important;
    /* Override text-truncate */
}

/* Modal Image Optimization for Mobile */
@media (max-width: 768px) {
    .modal-body .col-md-6:first-child .img-fluid {
        max-height: 250px;
        /* Limite height */
        width: 100%;
        object-fit: cover;
        margin-bottom: 1rem;
    }

    /* Feature Card Mobile Optimization */
    .icon-circle {
        width: 45px !important;
        height: 45px !important;
    }

    .icon-circle i {
        font-size: 1.5rem !important;
        /* Smaller icon */
    }

    .small-mobile {
        font-size: 0.9rem !important;
        /* Smaller text */
    }

    .feature-card {
        padding: 1rem !important;
        /* Reduce padding */
    }

    /* GLOBAL MOBILE SCALING */
    html {
        font-size: 14px;
        /* Scale down base font size */
        overflow-x: hidden;
        /* Force hide overflow on root */
        width: 100%;
    }

    body {
        overflow-x: hidden;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Prevent Image Overflow */
    /* Prevent Image/Iframe Overflow */
    img,
    video,
    canvas,
    svg {
        max-width: 100%;
        height: auto;
    }

    iframe {
        max-width: 100%;
    }

    /* Responsive Iframe Wrapper */
    .ratio-16x9 iframe {
        width: 100%;
        height: 100%;
    }

    /* Horizontal Scroll for Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Optimize Hero Text for better fit */
    .hero-text h1 {
        font-size: 2.2rem !important;
        /* Smaller on mobile */
    }

    .section-title {
        font-size: 1.5rem !important;
    }

    /* Compact Tables */
    .table-dark-custom th,
    .table-dark-custom td {
        padding: 0.5rem 0.25rem !important;
        /* Tighter padding */
        font-size: 0.8rem !important;
        /* Smaller font */
    }

    .table-dark-custom th {
        font-size: 0.75rem !important;
        /* Even smaller headers */
        letter-spacing: 0px;
    }

    .img-sparepart {
        width: 35px !important;
        height: 35px !important;
    }

    /* Service Card Compression */
    .card-service-small {
        min-width: 240px !important;
        /* Narrower cards */
        padding: 1rem !important;
        /* Less padding */
    }

    .card-service-small i {
        font-size: 1.2rem !important;
        /* Smaller icon */
    }

    .section-title {
        font-size: 1.25rem !important;
        /* Smaller headers */
    }

    /* Adjust Badge Sizes */
    .badge {
        font-size: 0.7rem !important;
        padding: 0.35em 0.5em !important;
    }
}

/* =========================================
   DASHBOARD WIDGETS (Admin/Owner)
   ========================================= */
.card-dashboard {
    border: none;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.card-dashboard:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.icon-box {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 26px;
    transition: transform 0.3s;
}

.card-dashboard:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #4e73df, #224abe);
    color: white;
}

.bg-gradient-success {
    background: linear-gradient(135deg, #1cc88a, #13855c);
    color: white;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #36b9cc, #258391);
    color: white;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f6c23e, #dda20a);
    color: white;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fc;
}

.badge-soft-primary {
    background-color: #e8f0fe;
    color: #4e73df;
}

.badge-soft-success {
    background-color: #e6fffa;
    color: #1cc88a;
}

.badge-soft-warning {
    background-color: #fffbeb;
    color: #f6c23e;
}

.badge-soft-danger {
    background-color: #feeced;
    color: #e74a3b;
}

.badge-soft-info {
    background-color: #e0f2f1;
    color: #36b9cc;
}

.badge-soft-secondary {
    background-color: #f1f3f5;
    color: #6c757d;
}