/* ============================================
   🌙 Dark Theme - Modern Shop UI
   ============================================ */

:root {
    /* Primary Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    
    /* Accent Colors */
    --accent-cyan: #00d4ff;
    --accent-pink: #ff0080;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #ff0080 100%);
    --gradient-card: linear-gradient(135deg, rgba(0,212,255,0.1) 0%, rgba(255,0,128,0.1) 100%);
    --gradient-glow: linear-gradient(135deg, rgba(0,212,255,0.3) 0%, rgba(255,0,128,0.3) 100%);
    
    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 212, 255, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.2);
    
    /* Animation */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Backward compatibility with old theme */
    --main: var(--accent-cyan);
    --sub: var(--accent-pink);
    --sub-opa-50: rgba(0, 212, 255, 0.5);
    --sub-opa-25: rgba(0, 212, 255, 0.25);
}

/* ============================================
   Base Styles
   ============================================ */

* {
    font-family: 'Kanit', sans-serif;
    box-sizing: border-box;
}

body {
    background: var(--bg-primary) !important;
    background-image: 
        radial-gradient(ellipse at top left, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(255, 0, 128, 0.08) 0%, transparent 50%) !important;
    min-height: 100vh;
    color: var(--text-primary);
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

p, span, label {
    color: var(--text-secondary);
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-pink);
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    opacity: 1;
}

/* ============================================
   Glassmorphism Cards
   ============================================ */

.glass-card, 
.card, 
.card-body,
.bg-white,
.container-fluid.bg-white,
.container.bg-white {
    background: var(--bg-card) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
}

.glass-card:hover,
.card:hover {
    background: var(--bg-card-hover) !important;
    border-color: var(--border-glow) !important;
    box-shadow: var(--shadow-glow);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition-normal);
    border: none;
}

.btn-primary, .bg-main, .btn.bg-main {
    background: var(--gradient-primary) !important;
    color: var(--text-primary) !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover, .bg-main:hover, .btn.bg-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5);
}

.btn-secondary {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

.btn-secondary:hover {
    background: var(--bg-card-hover) !important;
    border-color: var(--accent-cyan) !important;
}

.btn-success {
    background: var(--accent-green) !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--accent-red) !important;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

/* Neon Button */
.btn-neon {
    position: relative;
    background: transparent;
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
    overflow: hidden;
}

.btn-neon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: var(--transition-normal);
    z-index: -1;
}

.btn-neon:hover::before {
    left: 0;
}

.btn-neon:hover {
    color: var(--text-primary);
    border-color: transparent;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

/* ============================================
   Form Elements
   ============================================ */

.form-control, 
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    padding: 12px 16px;
    transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1) !important;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

/* ============================================
   Navbar
   ============================================ */

.navbar {
    background: rgba(10, 10, 15, 0.9) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
}

.navbar-brand img {
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.3));
}

.nav-link {
    color: var(--text-secondary) !important;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent-cyan) !important;
    background: rgba(0, 212, 255, 0.1);
}

.nav-link.active {
    color: var(--accent-cyan) !important;
}

.dropdown-menu {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 8px !important;
    box-shadow: var(--shadow-lg);
}

.dropdown-item {
    color: var(--text-secondary) !important;
    border-radius: 8px;
    padding: 10px 16px;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(0, 212, 255, 0.1) !important;
    color: var(--accent-cyan) !important;
}

.dropdown-divider {
    border-color: var(--border-color);
}

.user-quick-menu {
    min-width: 280px;
}

.user-quick-menu .dropdown-item-text {
    color: #facc15 !important;
    font-weight: 600;
    padding: 8px 12px;
    font-size: 0.95rem;
}

.user-quick-menu .dropdown-item {
    font-weight: 600;
}

/* ============================================
   Product Cards
   ============================================ */

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-normal);
}

.product-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
}

.product-card img {
    transition: var(--transition-normal);
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-price {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* ============================================
   Stats Cards
   ============================================ */

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    transition: var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: var(--shadow-glow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Modal
   ============================================ */

.modal-content {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
}

.modal-title {
    color: var(--text-primary);
}

.btn-close {
    filter: invert(1);
}

/* ============================================
   Tables
   ============================================ */

.table {
    color: var(--text-primary);
}

.table thead th {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-cyan);
    border-bottom: 1px solid var(--border-color);
}

.table tbody td {
    border-color: var(--border-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.table-hover tbody tr:hover {
    background: rgba(0, 212, 255, 0.05);
}

/* ============================================
   Alerts & Badges
   ============================================ */

.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 500;
}

.badge.bg-success {
    background: rgba(16, 185, 129, 0.2) !important;
    color: var(--accent-green) !important;
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: var(--accent-red) !important;
}

.badge.bg-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: var(--accent-yellow) !important;
}

.badge.bg-primary {
    background: rgba(0, 212, 255, 0.2) !important;
    color: var(--accent-cyan) !important;
}

/* ============================================
   Footer
   ============================================ */

footer, .container-fluid.bg-white.shadow {
    background: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Animations
   ============================================ */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 30px rgba(0, 212, 255, 0.6); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   Utility Classes
   ============================================ */

.text-main, .text-primary-custom {
    color: var(--accent-cyan) !important;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.border-glow {
    border: 1px solid var(--border-glow) !important;
    box-shadow: var(--shadow-glow);
}

.shadow-glow {
    box-shadow: var(--shadow-glow) !important;
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* ============================================
   Carousel
   ============================================ */

.carousel {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

/* ============================================
   Text Colors Override
   ============================================ */

.text-dark {
    color: var(--text-primary) !important;
}

.text-muted, .text-secondary {
    color: var(--text-secondary) !important;
}

/* ============================================
   Old Theme Compatibility
   ============================================ */

.bg-main-gra {
    background: var(--gradient-primary) !important;
}

.main-badge {
    background: var(--gradient-primary);
    border-radius: 8px;
}

.underline-active {
    color: var(--text-secondary);
}

.underline-active::after {
    background: var(--accent-cyan);
}

.underline-active:hover {
    color: var(--accent-cyan) !important;
}

/* Border Override */
.border, .border-2, .shadow-sm, .shadow {
    border-color: var(--border-color) !important;
}

/* ============================================
   Mobile UX (Banking App-inspired)
   ============================================ */
@media (max-width: 991.98px) {
    body {
        background: #f3f6f5 !important;
        background-image: none !important;
        color: #1f2937;
    }

    .main-navbar,
    .navbar {
        background: linear-gradient(135deg, #1fa968 0%, #12905b 100%) !important;
        border-bottom: none !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
        border-radius: 0 0 18px 18px;
    }

    .navbar-text-brand,
    .nav-link,
    .nav-link i,
    .navbar-toggler i {
        color: #fff !important;
    }

    .navbar .collapse {
        background: rgba(255, 255, 255, 0.12);
        border-radius: 14px;
        margin-top: 10px;
        padding: 10px;
    }

    .user-menu-trigger {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.8);
        background: rgba(255, 255, 255, 0.16);
        color: #fff !important;
        padding: 0 !important;
    }

    .user-menu-trigger::after {
        margin-left: 0.35rem;
    }

    .user-quick-menu {
        min-width: min(94vw, 340px);
        max-width: min(94vw, 340px);
        border-radius: 16px !important;
        border: 1px solid #d4e8de !important;
        background: #fff !important;
        box-shadow: 0 12px 30px rgba(16, 24, 40, 0.16) !important;
    }

    .user-quick-menu .dropdown-item-text {
        color: #16a34a !important;
        font-weight: 700;
    }

    .user-quick-menu .dropdown-item {
        color: #0f172a !important;
        border-radius: 10px;
        padding: 11px 12px;
    }

    .user-quick-menu .dropdown-item:hover {
        background: #edfdf3 !important;
        color: #15803d !important;
    }

    .card,
    .glass-card,
    .xez-card,
    .btshop-card,
    .stat-card,
    .modal-content {
        background: #fff !important;
        border: 1px solid #dfe7e3 !important;
        border-radius: 16px !important;
        box-shadow: 0 8px 24px rgba(16, 24, 40, 0.08) !important;
    }

    .text-muted,
    .text-secondary {
        color: #6b7280 !important;
    }

    .text-dark,
    h1, h2, h3, h4, h5, h6,
    p, span, label {
        color: #111827 !important;
    }

    .btn,
    .btn-primary,
    .btn-success,
    .btn-danger,
    .btn-dark,
    .xez-btn-cyan,
    .btshop-btn-cyan,
    .btn-navbar-register {
        min-height: 44px;
        border-radius: 12px !important;
    }

    .btn-primary,
    .xez-btn-cyan,
    .btshop-btn-cyan,
    .btn-navbar-register {
        background: linear-gradient(135deg, #1fa968 0%, #12905b 100%) !important;
        color: #fff !important;
        border: none !important;
        box-shadow: 0 8px 18px rgba(18, 144, 91, 0.28) !important;
    }

    .form-control,
    .form-select,
    input,
    textarea,
    select {
        background: #fff !important;
        border: 1px solid #d1d5db !important;
        color: #111827 !important;
    }

    .form-control:focus,
    .form-select:focus,
    input:focus,
    textarea:focus,
    select:focus {
        border-color: #16a34a !important;
        box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16) !important;
    }
}
