/* --- PREMIUM GAMING THEME (Glassmorphism + Neon) --- */

:root {
    /* Core Brand Colors (extracted from existing logic but refined) */
    --primary-color: var(--main);
    /* Use PHP injected variable */
    --secondary-color: var(--sub);
    /* Use PHP injected variable */

    /* Modern Palette */
    --bg-dark: #09090b;
    --bg-card: rgba(22, 22, 26, 0.6);
    --bg-card-hover: rgba(30, 30, 35, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    --neon-glow: 0 0 10px rgba(var(--main-rgb), 0.5);

    /* Typography */
    --font-heading: 'Kanit', sans-serif;
    --font-body: 'Kanit', sans-serif;
}

/* --- GLOBAL RESETS & TYPOGRAPHY --- */
body {
    background-color: var(--bg-dark);
    color: #e4e4e7;
    font-family: var(--font-body);
    font-weight: 300;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 1rem;
}

a {
    transition: all 0.3s ease;
    text-decoration: none;
}

/* --- GLASSMORPHISM UTILITIES --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--glass-highlight);
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 20px color-mix(in srgb, var(--primary-color), transparent 85%);
}

.glass-header {
    background: rgba(13, 13, 16, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

/* --- BUTTONS & ACTIONS --- */
.btn-premium {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    padding: 10px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--primary-color), transparent 60%);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--primary-color), transparent 40%);
    color: #fff;
    filter: brightness(1.1);
}

.btn-premium-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: #a1a1aa;
    border-radius: 12px;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

.btn-premium-outline:hover {
    border-color: var(--primary-color);
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 15px color-mix(in srgb, var(--primary-color), transparent 90%);
}

/* --- NAVBAR STYLING --- */
.navbar {
    background: rgba(9, 9, 11, 0.85) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.nav-link-custom {
    color: #a1a1aa !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link-custom:hover,
.nav-link-custom.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link-custom.active {
    color: var(--primary-color) !important;
    background: color-mix(in srgb, var(--primary-color), transparent 90%);
}

/* --- SECTION TITLES --- */
.section-title {
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* --- STATS BOXES --- */
.stat-box-premium {
    background: rgba(10, 10, 12, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    transition: all 0.3s ease;
    height: 100%;
}

.stat-box-premium:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.stat-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    box-shadow: 0 0 20px color-mix(in srgb, var(--primary-color), transparent 90%);
    transition: all 0.4s ease;
}

.stat-box-premium:hover .stat-icon-circle {
    transform: scale(1.15) rotate(15deg);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 25px color-mix(in srgb, var(--primary-color), transparent 60%);
}

/* --- BADGES & TAGS --- */
.badge-premium {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-stock-in {
    background: color-mix(in srgb, #22c55e, transparent 90%);
    color: #22c55e;
    border: 1px solid color-mix(in srgb, #22c55e, transparent 70%);
}

.badge-stock-out {
    background: color-mix(in srgb, #ef4444, transparent 90%);
    color: #ef4444;
    border: 1px solid color-mix(in srgb, #ef4444, transparent 70%);
}

/* --- ANIMATIONS --- */
@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px color-mix(in srgb, var(--primary-color), transparent 70%);
    }

    50% {
        box-shadow: 0 0 25px color-mix(in srgb, var(--primary-color), transparent 50%);
    }
}

.glow-effect {
    animation: glow-pulse 3s infinite;
}

/* --- HOME PAGE HERO (Optional Refinement) --- */
.carousel-item img {
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

/* --- FOOTER --- */
.fixed-copyright-bar {
    background: rgba(5, 5, 5, 0.95);
    border-top: 1px solid var(--glass-border);
}

/* --- SWAL MODAL OVERRIDE --- */
.custom-modal-ui {
    background: #18191c !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 20px !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8) !important;
}

/* --- PRODUCT SPOTLIGHT (Added in Phase 2) --- */
.product-card-premium {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-premium::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(var(--primary-color), 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.product-card-premium:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6),
        0 0 30px color-mix(in srgb, var(--primary-color), transparent 85%);
}

.product-card-premium:hover::before {
    opacity: 1;
}

.product-img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-img-wrapper img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card-premium:hover .product-img-wrapper img {
    transform: scale(1.1);
}

/* Shine Effect */
.product-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
    pointer-events: none;
}

.product-card-premium:hover .product-img-wrapper::after {
    left: 150%;
    transition: 0.7s;
}

/* Enhanced Badges */
.badge-floating {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 2;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge-instock {
    background: rgba(22, 163, 74, 0.85);
    /* Green */
    color: #fff;
    box-shadow: 0 0 15px rgba(22, 163, 74, 0.4);
}

.badge-nostock {
    background: rgba(220, 38, 38, 0.85);
    /* Red */
    color: #fff;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.4);
}

/* Content Area */
.product-content {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 12px;
    text-shadow: 0 0 15px color-mix(in srgb, var(--primary-color), transparent 60%);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.product-price small {
    font-size: 0.8rem;
    color: #71717a;
    text-decoration: line-through;
    font-weight: 400;
}

/* Call to Action Button */
.btn-cta-buy {
    width: 100%;
    padding: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-cta-buy:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px color-mix(in srgb, var(--primary-color), transparent 40%);
    color: #fff;
}

/* --- DATATABLES GLOBAL PAGINATION --- */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
    margin: 0 2px;
    padding: 5px 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--primary-color) !important;
    color: #fff !important;
    border: 1px solid var(--primary-color) !important;
    box-shadow: 0 0 10px color-mix(in srgb, var(--primary-color), transparent 60%);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    color: #666 !important;
    background: transparent !important;
    border: none !important;
    cursor: not-allowed;
}

/* Fix Dropdown & Search Input globally */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
    padding: 4px 10px;
}

/* Enable black background for GLOBAL dropdown options */
.dataTables_wrapper .dataTables_length select option {
    background-color: #111 !important;
    color: #fff !important;
}