/* Import Google Font Inter and Plus Jakarta Sans */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #630ed4;              /* LuxeDigital Electric Purple */
    --primary-hover: #7c3aed;        /* LuxeDigital Primary Container */
    --primary-light: rgba(99, 14, 212, 0.05);
    --secondary: #565e74;            /* LuxeDigital Steel Blue */
    --secondary-hover: #3f465c;
    --success: #10b981;
    --success-hover: #059669;
    --warning: #f59e0b;
    --danger: #ba1a1a;               /* LuxeDigital Error */
    --dark-bg: #f8f9ff;             /* LuxeDigital Background Canvas */
    --dark-card: #ffffff;           /* LuxeDigital Surface Container Lowest */
    --dark-border: rgba(204, 195, 216, 0.45); /* LuxeDigital Outline Variant */
    --dark-text: #0b1c30;           /* LuxeDigital On-Surface */
    --dark-muted: #4a4455;          /* LuxeDigital On-Surface-Variant */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-blur: 12px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    font-family: var(--font-body);
    background-color: var(--dark-bg) !important;
    color: var(--dark-text) !important;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: none !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #000000 !important;
}

p, span, label, td, th, li, a {
    color: #000000; /* Force black default */
}

.text-muted, .text-muted-custom {
    color: var(--dark-muted) !important;
}

/* Panel Containers */
.glass-panel {
    background: var(--dark-card) !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

/* Header & Navigation */
.navbar-custom {
    background: #ffffff !important;
    border-bottom: 1px solid var(--dark-border) !important;
    padding: 15px 0;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #4f46e5, #0ea5e9) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.nav-link-custom {
    color: #000000 !important;
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.nav-link-custom:hover {
    color: var(--primary) !important;
    background: var(--primary-light) !important;
}

/* Premium Buttons */
.btn-premium {
    font-family: var(--font-heading);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-premium-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-premium-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    color: #ffffff !important;
}

.btn-premium-secondary {
    background: #f1f5f9 !important;
    color: #000000 !important;
    border: 1px solid var(--dark-border) !important;
}

.btn-premium-secondary:hover {
    background: #e2e8f0 !important;
    color: #000000 !important;
    transform: translateY(-2px);
}

/* Product Card Grid */
.product-card {
    background: #ffffff !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.product-image-wrapper {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    background: #f1f5f9;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.8) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    color: #000000 !important;
}

.product-price-wrapper {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-main {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary) !important;
}

.price-discount {
    text-decoration: line-through;
    color: var(--dark-muted) !important;
    font-size: 14px;
}

/* Category Badge */
.category-badge {
    background: #e2e8f0 !important;
    border: 1px solid var(--dark-border) !important;
    color: #000000 !important;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.category-badge:hover {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Input Fields overrides */
.form-input-premium {
    background: #ffffff !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: var(--radius-sm);
    color: #000000 !important;
    padding: 12px 16px;
    transition: var(--transition);
}

.form-input-premium:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15) !important;
    color: #000000 !important;
}

.form-input-premium::placeholder {
    color: #64748b !important;
}

/* Custom Table Wrapper */
.table-responsive-custom {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--dark-border) !important;
    background: #ffffff;
}

.table-custom {
    margin-bottom: 0;
}

.table-custom th {
    background-color: #f1f5f9 !important;
    color: #000000 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 15px 20px;
    border-bottom: 2px solid var(--dark-border) !important;
}

.table-custom td {
    background-color: transparent !important;
    color: #000000 !important;
    padding: 18px 20px;
    border-bottom: 1px solid var(--dark-border) !important;
    vertical-align: middle;
}

.table-custom tr:last-child td {
    border-bottom: none !important;
}

/* Toast Notifications styling override */
.toast-container-custom {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1090;
}

.toast-custom {
    background: #ffffff !important;
    border: 1px solid var(--dark-border) !important;
    color: #000000 !important;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Stats Widgets */
.stat-card {
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: #f8fafc !important;
}

.stat-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 80px;
    opacity: 0.08 !important;
    color: var(--primary);
    transform: rotate(-15deg);
}

/* Reviews and Ratings */
.rating-stars {
    color: var(--warning);
    font-size: 18px;
    display: inline-flex;
    gap: 2px;
}

.rating-stars-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.rating-stars-input input {
    display: none;
}

.rating-stars-input label {
    font-size: 30px;
    color: #cbd5e1 !important;
    cursor: pointer;
    transition: var(--transition);
}

.rating-stars-input label:hover,
.rating-stars-input label:hover ~ label,
.rating-stars-input input:checked ~ label {
    color: var(--warning) !important;
}

/* Custom Footer */
.footer-custom {
    background: #f8fafc !important;
    border-top: 1px solid var(--dark-border) !important;
    padding: 60px 0 30px 0;
    margin-top: 80px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    background: linear-gradient(to right, #4f46e5, #0ea5e9) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.footer-custom a, .footer-custom p {
    color: var(--dark-muted) !important;
}

.footer-custom a:hover {
    color: var(--primary) !important;
}

/* ==========================================================================
   Light Mode Specific Theme Overrides (High-Contrast Readability)
   ========================================================================== */

/* Force all text in body, cards, and tables to default to black */
body, 
.glass-panel, 
.product-card, 
.table-custom, 
.navbar-custom, 
.footer-custom, 
.admin-sidebar, 
.admin-content,
.card {
    color: #000000 !important;
}

/* Force hardcoded Bootstrap text-white classes to render in black */
.text-white, 
h1.text-white, 
h2.text-white, 
h3.text-white, 
h4.text-white, 
h5.text-white, 
h6.text-white,
.glass-panel .text-white,
.product-card .text-white,
.table-custom .text-white,
.admin-content .text-white,
.admin-sidebar .text-white {
    color: #000000 !important;
}

/* Ensure links and navigation items render in black */
a, 
a.text-white, 
.product-title a, 
.sidebar-link {
    color: #000000 !important;
}

a:hover, 
a.text-white:hover, 
.product-title a:hover {
    color: var(--primary) !important;
}

/* Make category dropdown list items visible on white header */
.dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid var(--dark-border) !important;
}

.dropdown-item {
    color: #000000 !important;
}

.dropdown-item:hover {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
}

/* Preserving white text only on dark background elements */
.btn-premium-primary, 
.btn-primary, 
.badge, 
.product-tag,
.sidebar-link.active,
.sidebar-link.active *,
.sidebar-link:hover,
.sidebar-link:hover * {
    color: #ffffff !important;
}

/* Soften light-gray thumbnails inside card boxes */
.product-image-wrapper .bg-dark {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

/* ==========================================================================
   Smooth Page Transitions & Top Progress Loading Bar Animations
   ========================================================================== */

/* Page Fade-In Animation */
@keyframes fadeInPage {
    from { 
        opacity: 0; 
        transform: translateY(8px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

body {
    animation: fadeInPage 0.35s ease-out forwards;
}

/* Next.js/GitHub style Top Progress Loading Bar */
#top-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, #4f46e5, #0ea5e9, #10b981);
    z-index: 99999;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.08, 0.82, 0.17, 1);
    opacity: 1;
}

#top-loading-bar.finish {
    width: 100% !important;
    opacity: 0;
    transition: width 0.2s ease, opacity 0.3s ease 0.2s;
}

/* ==========================================================================
   Premium Full-Screen Page Preloader
   ========================================================================== */

#page-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Seamless light theme background matching canvas */
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader-content {
    text-align: center;
}

/* Glowing spinner ring matching system core indigo */
.preloader-spinner {
    width: 55px;
    height: 55px;
    border: 3.5px solid rgba(79, 70, 229, 0.08);
    border-radius: 50%;
    border-top-color: #4f46e5;
    animation: preloader-spin 0.85s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
    margin: 0 auto 20px auto;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.15);
}

.preloader-logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.preloader-text {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    animation: preloader-pulse 1.6s ease-in-out infinite;
}

@keyframes preloader-spin {
    to { transform: rotate(360deg); }
}

@keyframes preloader-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Graceful dismissal wrapper state */
#page-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* ==========================================================================
   Premium Hover Transitions & Section Entrance Slide Animations
   ========================================================================== */

/* Smooth Card Hover transitions */
.product-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease !important;
}

.product-card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(79, 70, 229, 0.04) !important;
    border-color: rgba(79, 70, 229, 0.25) !important;
}

.product-image-wrapper {
    overflow: hidden;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
}

.product-image {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.product-card:hover .product-image {
    transform: scale(1.06) !important;
}

/* Staggered entrance fade-in & slide-up animations */
@keyframes slideUpEntrance {
    from {
        opacity: 0;
        transform: translateY(35px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered entrance selectors */
section, 
.admin-content,
.user-dashboard-content {
    animation: slideUpEntrance 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Delay staggered levels for fluid transition flow */
section:nth-of-type(1) { animation-delay: 0.05s; }
section:nth-of-type(2) { animation-delay: 0.15s; }
section:nth-of-type(3) { animation-delay: 0.25s; }
section:nth-of-type(4) { animation-delay: 0.35s; }

/* ==========================================================================
   Premium Infinite Category Ticker / Marquee
   ========================================================================== */

.category-ticker-container {
    overflow: hidden;
    padding: 15px 0;
    position: relative;
    width: 100%;
}

/* Fade masks to blend items into the edges */
.ticker-mask-left, .ticker-mask-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 120px;
    z-index: 2;
    pointer-events: none;
}
.ticker-mask-left {
    left: 0;
    background: linear-gradient(to right, var(--dark-bg) 20%, transparent 100%);
}
.ticker-mask-right {
    right: 0;
    background: linear-gradient(to left, var(--dark-bg) 20%, transparent 100%);
}

.category-ticker-track {
    display: flex;
    gap: 20px;
    width: max-content;
    animation: ticker-scroll 24s linear infinite;
}

.category-ticker-track:hover {
    animation-play-state: paused;
}

.category-ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff !important;
    border: 1px solid var(--dark-border) !important;
    border-radius: 50px !important; /* Premium Pill Shape */
    padding: 14px 28px !important;
    text-decoration: none !important;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03) !important;
}

.category-ticker-item i {
    font-size: 1.3rem;
    color: var(--primary) !important;
    line-height: 1;
}

.category-ticker-item span {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark-text) !important;
    white-space: nowrap;
    font-family: var(--font-heading);
}

.category-ticker-item:hover {
    transform: translateY(-4px) scale(1.02) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 12px 24px rgba(99, 14, 212, 0.12) !important;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.3333%); } /* Loop seamlessly over duplicated list block */
}


