@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --brand-color: #4F46E5;
    --brand-hover: #4338CA;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

/* Typography & Brand Utilities */
.text-brand { color: var(--brand-color) !important; }
/* Magically allows Bootstrap's bg-opacity utilities to work on your custom brand color */
.bg-brand {
    background-color: rgba(79, 70, 229, var(--bs-bg-opacity, 1)) !important;
}

/* Custom Buttons */
.btn-brand {
    background-color: var(--brand-color);
    color: var(--bg-white);
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
}

.btn-brand:hover {
    background-color: var(--brand-hover);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Cards & Hover Effects */
.card-hover {
    border: none;
    border-radius: 16px;
    background-color: var(--bg-white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.1);
}

/* Layout Utilities */
.section-padding { padding: 80px 0; }
.bg-white-section { background-color: var(--bg-white); }

/* Navigation */
.navbar {
    background-color: var(--bg-white);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}
.navbar-brand { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.5px; }

/* Icon Wrappers */
.icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--brand-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

/* --- Added for Auth Page --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.auth-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 2.5rem;
}

.nav-pills .nav-link {
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.nav-pills .nav-link.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--brand-color);
}

.form-control {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.form-control:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.1);
}

.btn-social {
    border: 1px solid #E5E7EB;
    background: var(--bg-white);
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.6rem;
    border-radius: 8px;
    transition: all 0.2s;
    width: 100%;
}

.btn-social:hover {
    background: var(--bg-light);
}



/* --- Added for Dashboard & App Layout --- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-light);
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background-color: var(--bg-white);
    border-right: 1px solid #E5E7EB;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-color);
    text-decoration: none;
    border-bottom: 1px solid #E5E7EB;
}

.sidebar-nav {
    padding: 1.5rem 1rem;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--brand-color);
}

.sidebar-link i {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* Main Content & Topbar */
.main-content {
    flex-grow: 1;
    min-width: 0; /* Prevents flexbox overflow */
    display: flex;
    flex-direction: column;
}

.topbar {
    background-color: var(--bg-white);
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E5E7EB;
}

/* Custom Tables */
.table-custom th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 1rem;
    border-top: none;
}

.table-custom td {
    padding: 1.25rem 0.5rem;
    vertical-align: middle;
    color: var(--text-dark);
    border-bottom: 1px solid #F3F4F6;
}

/* Soft Badges for Statuses */
.badge-soft-success { background-color: rgba(16, 185, 129, 0.1); color: #10B981; padding: 0.4em 0.8em; }
.badge-soft-warning { background-color: rgba(245, 158, 11, 0.1); color: #F59E0B; padding: 0.4em 0.8em; }
.badge-soft-secondary { background-color: rgba(107, 114, 128, 0.1); color: #6B7280; padding: 0.4em 0.8em; }


/* --- Added for Add Product Page --- */
/* =========================================
   DRAG & DROP ZONE UI
   ========================================= */
.border-dashed {
    border-style: dashed !important;
}
.cursor-pointer {
    cursor: pointer;
}

/* Default Light Mode State */
.dropzone-area {
    background-color: #f8fafc;
    transition: all 0.3s ease;
}
.dropzone-area:hover, 
.dropzone-area.dragover {
    background-color: #e0e7ff; /* Soft brand blue tint */
    border-color: #4f46e5 !important; /* Brand blue border */
}

/* Dark Mode State */
[data-bs-theme="dark"] .dropzone-area {
    background-color: #0f172a !important;
    border-color: #334155 !important;
}
[data-bs-theme="dark"] .dropzone-area:hover,
[data-bs-theme="dark"] .dropzone-area.dragover {
    background-color: #1e293b !important;
    border-color: #3b82f6 !important;
}


/* --- Added for Storefront --- */
.storefront-nav {
    background-color: var(--bg-white);
    padding: 1rem 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Store Banner */
.store-banner {
    background-color: var(--brand-color);
    color: var(--bg-white);
    padding: 4rem 2rem;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.store-banner::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none; /* Firefox */
}
.category-filters::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.category-pill {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--bg-white);
    border: 1px solid #E5E7EB;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-pill:hover, .category-pill.active {
    background-color: var(--brand-color);
    color: var(--bg-white);
    border-color: var(--brand-color);
}

/* Product Cards */
.product-card {
    border: none;
    background: transparent;
}

.product-img-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background-color: #F3F4F6;
    margin-bottom: 1rem;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.quick-view-btn {
    position: absolute;
    bottom: -50px; /* Hidden below */
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.product-card:hover .quick-view-btn {
    bottom: 15px;
    opacity: 1;
}

.quick-view-btn:hover {
    background-color: var(--bg-white);
    color: var(--brand-color);
}

/* Cart Offcanvas */
.cart-item-img {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #F3F4F6;
}

.qty-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #F3F4F6;
    border: none;
    color: var(--text-dark);
}
.qty-btn:hover { background: #E5E7EB; }

/* Animation for Cart Badge */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.animate-pop { animation: pop 0.3s ease-in-out; }

/* --- Added for Product Detail Page --- */
.product-detail-img-wrapper {
    background-color: #F3F4F6;
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qty-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-white);
}

.qty-input-group .btn {
    border: none;
    background: transparent;
    padding: 0.5rem 1rem;
    color: var(--text-dark);
}

.qty-input-group .btn:hover {
    background-color: var(--bg-light);
}

.qty-input-group input {
    border: none;
    text-align: center;
    width: 50px;
    font-weight: 500;
    padding: 0;
    -moz-appearance: textfield; /* Hide arrows in Firefox */
}
.qty-input-group input::-webkit-outer-spin-button,
.qty-input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Hide arrows in Chrome/Safari */
    margin: 0;
}


/* --- Added for Checkout Page --- */
/* Payment Method Radio Cards */
.payment-card {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-white);
    display: flex;
    align-items: center;
}

.payment-card:hover {
    border-color: var(--brand-color);
    background-color: rgba(79, 70, 229, 0.02);
}

.payment-card .form-check-input {
    margin-top: 0;
    margin-right: 1rem;
    cursor: pointer;
}

.payment-card .form-check-input:checked {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
}

/* We use a hidden radio button trick to style the whole card when selected */
.payment-card:has(input:checked) {
    border-color: var(--brand-color);
    background-color: rgba(79, 70, 229, 0.05);
    box-shadow: 0 0 0 1px var(--brand-color);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.checkout-summary-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background-color: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* --- Added for Order Confirmation Page --- */
.success-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.1);
    color: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem auto;
    position: relative;
}

/* Pulsing animation for the success ring */
.success-icon-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 2px solid #10B981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Floating Dashboard Button */
.floating-dashboard-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #6366f1; /* Your brand color */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1050; /* Keeps it above modals and offcanvas carts */
    transition: all 0.3s ease;
    text-decoration: none;
}

.floating-dashboard-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    color: white;
}



/* =========================================
   DARK MODE CUSTOMIZATIONS
   ========================================= */

/* Target the entire page when dark mode is active */
[data-bs-theme="dark"] body {
    background-color: #0b1121; /* Deep digital slate */
    color: #f8fafc;
}

/* Convert white sections and light backgrounds to deep navy */
[data-bs-theme="dark"] .bg-white-section,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white {
    background-color: #0f172a !important; 
    color: #f8fafc !important;
}

/* Elevate the cards so they pop against the dark background */
[data-bs-theme="dark"] .card-hover {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5) !important;
}

/* Ensure text headings remain highly visible */
[data-bs-theme="dark"] .text-dark {
    color: #ffffff !important;
}

/* Soften the secondary text */
[data-bs-theme="dark"] .text-muted,
[data-bs-theme="dark"] .text-secondary {
    color: #94a3b8 !important;
}

/* Ensure borders don't look too harsh in dark mode */
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top {
    border-color: #334155 !important;
}

/* =========================================
   DARK MODE AUTHENTICATION FIXES
   ========================================= */

/* Fix the active tab on the Login/Signup card */
[data-bs-theme="dark"] .nav-pills .nav-link.active {
    background-color: #3b82f6 !important; /* Bright blue for visibility */
    color: #ffffff !important; /* Bright white text */
}

/* Dim the text of non-active tabs */
[data-bs-theme="dark"] .nav-pills .nav-link:not(.active) {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .nav-pills .nav-link:not(.active):hover {
    color: #f8fafc !important;
}

/* Fix the Form Input Fields */
[data-bs-theme="dark"] .form-control {
    background-color: #0f172a !important; /* Deep dark background */
    border: 1px solid #334155 !important; /* Subtle border */
    color: #f8fafc !important; /* White text input */
}

/* Style the Form Input when the user clicks on it */
[data-bs-theme="dark"] .form-control:focus {
    background-color: #1e293b !important; 
    border-color: #3b82f6 !important; /* Brand blue border */
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25) !important; /* Blue glow */
}

/* Ensure placeholder text isn't completely hidden */
[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b !important;
}

/* Labels and Checkboxes */
[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] .form-check-label {
    color: #cbd5e1 !important;
}

/* Fix secondary "Light" buttons in Dark Mode */
[data-bs-theme="dark"] .btn-light {
    background-color: #1e293b !important; /* Deep slate to match the cards */
    border-color: #334155 !important; /* Subtle border */
    color: #f8fafc !important; /* Bright white text */
}

/* Add a smooth hover effect for it */
[data-bs-theme="dark"] .btn-light:hover {
    background-color: #334155 !important; 
    color: #ffffff !important;
}




/* =========================================
   SCROLL REVEAL ANIMATIONS (Triggered by JS)
   ========================================= */

/* The starting state (hidden and pushed down slightly) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* The ending state (fully visible and back in place) */
.animate-on-scroll.show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   CONTINUOUS ANIMATIONS (No JS required)
   ========================================= */

/* Add this class to any icon you want to continuously float */
.floating-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); } /* Moves up 10 pixels */
    100% { transform: translateY(0px); }
}



/* =========================================
   HERO PARALLAX & IDLE ANIMATIONS
   ========================================= */

/* The invisible wrapper that moves with the mouse */
.hero-parallax-icon {
    transition: transform 0.1s ease-out;
    z-index: 0; /* Keeps them behind the main buttons */
}

/* The actual icon that floats, fades, and reacts to hover */
.hero-icon-inner {
    opacity: 0.5; /* Your requested base opacity */
    transition: all 0.3s ease;
    display: inline-block;
}

/* 3 Different animation timings so they don't look robotic */
.idle-anim-1 { animation: floatFade 4s ease-in-out infinite; }
.idle-anim-2 { animation: floatFade 5.5s ease-in-out infinite 1s; }
.idle-anim-3 { animation: floatFade 6.5s ease-in-out infinite 0.5s; }

/* The idle "breathing" effect */
@keyframes floatFade {
    0% { transform: translateY(0); opacity: 0.15; }
    50% { transform: translateY(-15px); opacity: 0.5; } /* Peaks at 0.5 */
    100% { transform: translateY(0); opacity: 0.15; }
}

/* When the user hovers directly over a background icon */
.hero-icon-inner:hover {
    opacity: 1 !important;
    transform: scale(1.3) translateY(-5px) !important;
    color: #1e3a8a !important; /* Turns deep blue to show interaction */
    cursor: crosshair; 
    animation-play-state: paused; /* Stops the floating while hovered */
}



/* =========================================
   GLOBAL PAGE LOADER (VIBRANT EDITION)
   ========================================= */

/* The full-screen overlay with an animated gradient */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* The Magic: A slow-moving vibrant brand gradient */
    background: linear-gradient(-45deg, #4f46e5, #1e3a8a, #7c3aed, #3b82f6);
    background-size: 400% 400%;
    animation: gradientBG 10s ease infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

/* The Gradient Animation Keyframes */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* The pulsing shopping bag (Now White & Glowing) */
.loader-icon {
    font-size: 5.5rem; /* Made it slightly bigger */
    color: #ffffff;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.4)); /* Soft glow */
    animation: pulseBag 1.5s ease-in-out infinite;
    z-index: 2;
    position: relative;
}

/* The smooth scaling keyframes */
@keyframes pulseBag {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

/* =========================================
   BACKGROUND LOADER ICONS (FROSTED GLASS EFFECT)
   ========================================= */
.bg-icon {
    position: absolute;
    font-size: 2.5rem;
    color: #ffffff; /* Changed all to white to contrast the dark background */
    z-index: 1;
}

/* Lowered the opacities slightly because white on dark pops aggressively */
.bg-icon-1 { top: 15%; left: 20%; opacity: 0.15; animation: float 4s ease-in-out infinite; }
.bg-icon-2 { top: 25%; right: 25%; opacity: 0.20; animation: float 3.5s ease-in-out infinite 0.5s; }
.bg-icon-3 { bottom: 20%; left: 30%; opacity: 0.25; animation: float 5s ease-in-out infinite 1s; }
.bg-icon-4 { bottom: 30%; right: 20%; opacity: 0.10; animation: float 4.5s ease-in-out infinite 0.2s; }
.bg-icon-5 { top: 40%; left: 10%; opacity: 0.15; animation: float 6s ease-in-out infinite 0.8s; }
.bg-icon-6 { top: 50%; right: 10%; opacity: 0.25; animation: float 5.5s ease-in-out infinite 1.2s; }
.bg-icon-7 { top: 10%; right: 15%; opacity: 0.20; animation: float 4.2s ease-in-out infinite 0.3s; }
.bg-icon-8 { bottom: 15%; right: 35%; opacity: 0.12; animation: float 5.2s ease-in-out infinite 0.7s; }
.bg-icon-9 { top: 70%; left: 20%; opacity: 0.22; animation: float 3.8s ease-in-out infinite 0.9s; }
.bg-icon-10 { bottom: 40%; left: 15%; opacity: 0.18; animation: float 4.8s ease-in-out infinite 0.4s; }
.bg-icon-11 { top: 65%; right: 20%; opacity: 0.15; animation: float 5.8s ease-in-out infinite 1.1s; }




/* =========================================
   DASHBOARD DARK MODE
   ========================================= */

/* Sidebar and Topbar */
[data-bs-theme="dark"] .sidebar {
    background-color: #0b1121 !important;
    border-right: 1px solid #1e293b !important;
}
[data-bs-theme="dark"] .topbar {
    background-color: #0f172a !important;
    border-bottom: 1px solid #1e293b !important;
}

/* Sidebar Links */
[data-bs-theme="dark"] .sidebar-link { color: #94a3b8; }
[data-bs-theme="dark"] .sidebar-link:hover,
[data-bs-theme="dark"] .sidebar-link.active {
    background-color: #1e293b;
    color: #ffffff;
}

/* Dashboard Background */
[data-bs-theme="dark"] .dashboard-wrapper .bg-light {
    background-color: #0b1121 !important; 
}

/* Tables */
[data-bs-theme="dark"] .table-custom th {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}
[data-bs-theme="dark"] .table-custom td {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border-bottom-color: #1e293b !important;
}

/* Dropdown Menus */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1e293b !important;
    border: 1px solid #334155 !important;
}
[data-bs-theme="dark"] .dropdown-item { color: #f8fafc !important; }
[data-bs-theme="dark"] .dropdown-item:hover { background-color: #334155 !important; }