* {
    box-sizing: border-box;
}

:root {
    --primary-color: #d4af37; /* Gold for lighting feel */
    --secondary-color: #1a1a1a;
    --bg-color: #121212;
    --text-color: #f5f5f5;
    --card-bg: #1e1e1e;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll from mobile menu */
}

/* Add padding for pages with fixed header */
body.has-fixed-header {
    padding-top: 120px;
}

/* Login page - no extra padding needed */
body.login-page {
    padding-top: 0;
}

/* Login Page */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    z-index: -2;
    overflow: hidden;
}

.login-background::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 40% 80%, rgba(0, 238, 255, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 60% 20%, rgba(255, 105, 180, 0.1) 0%, transparent 25%);
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-20px, 10px) rotate(90deg); }
    50% { transform: translate(10px, -20px) rotate(180deg); }
    75% { transform: translate(15px, 15px) rotate(270deg); }
    100% { transform: translate(0, 0) rotate(360deg); }
}

.light-beam {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(212, 175, 55, 0.8), 
        rgba(255, 255, 255, 0.6), 
        rgba(0, 238, 255, 0.8),
        transparent);
    top: 0;
    animation: lightSweep 8s linear infinite;
    filter: blur(1px);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.light-beam:nth-child(1) { left: 10%; animation-delay: 0s; }
.light-beam:nth-child(2) { left: 25%; animation-delay: 1s; }
.light-beam:nth-child(3) { left: 40%; animation-delay: 2s; }
.light-beam:nth-child(4) { left: 55%; animation-delay: 3s; }
.light-beam:nth-child(5) { left: 70%; animation-delay: 4s; }
.light-beam:nth-child(6) { left: 85%; animation-delay: 5s; }

@keyframes lightSweep {
    0% { transform: translateY(-100%); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: float 12s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

.particle:nth-child(1) { top: 20%; left: 15%; animation-delay: 0s; }
.particle:nth-child(2) { top: 40%; left: 85%; animation-delay: 2s; }
.particle:nth-child(3) { top: 60%; left: 25%; animation-delay: 4s; }
.particle:nth-child(4) { top: 80%; left: 75%; animation-delay: 6s; }
.particle:nth-child(5) { top: 30%; left: 65%; animation-delay: 8s; }
.particle:nth-child(6) { top: 70%; left: 45%; animation-delay: 10s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.2); }
    50% { transform: translate(-15px, 20px) scale(0.8); }
    75% { transform: translate(10px, 15px) scale(1.1); }
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 120px 20px 100px;
    position: relative;
    z-index: 10;
    background: transparent;
}

.login-card {
    background: rgba(30, 30, 30, 0.7);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.5),
        0 0 20px rgba(212, 175, 55, 0.2),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(212, 175, 55, 0.1),
        transparent 30%
    );
    animation: rotate 12s linear infinite;
    z-index: -1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.login-header p {
    color: #888;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #aaa;
}

.form-control {
    width: 100%;
    padding: 12px;
    background-color: #2a2a2a;
    border: 1px solid #333;
    border-radius: 5px;
    color: white;
    box-sizing: border-box; /* Important for padding */
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #c09b2d;
    transform: translateY(-2px);
}

/* Admin Panel */
.admin-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 140px; /* Fix for header overlap */
}

.sidebar {
    width: 250px;
    background-color: var(--card-bg);
    padding: 2rem;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
    margin-bottom: 3rem;
    text-align: center;
}

.sidebar-header h3 {
    color: var(--primary-color);
    margin: 0;
}

.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-menu li {
    margin-bottom: 1rem;
}

.nav-menu a {
    color: #888;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-menu a:hover, .nav-menu a.active {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.slider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.slider-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s;
}

.slider-card:hover {
    transform: translateY(-5px);
}

.slider-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.slider-actions {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-delete {
    background-color: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
    width: auto;
    padding: 5px 10px;
    font-size: 0.8rem;
}

.btn-delete:hover {
    background-color: var(--error-color);
    color: white;
}

.btn-add {
    width: auto;
    display: inline-block;
    padding: 10px 20px;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.flash-message {
    padding: 1rem 2rem;
    border-radius: 5px;
    margin-bottom: 10px;
    color: white;
    animation: slideIn 0.5s ease;
}

.flash-message.success {
    background-color: var(--success-color);
}

.flash-message.error {
    background-color: var(--error-color);
}

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

/* Category Carousel Styles */
.category-carousel-container {
    width: 100%;
    position: relative;
    padding: 0 70px; /* Increased padding for arrows */
}

.category-carousel-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
    padding: 20px 0;
}

.category-carousel-wrapper::-webkit-scrollbar { 
    display: none;  /* Chrome/Safari */
}

.category-carousel {
    display: flex;
    width: 100%; /* Fit to wrapper */
    gap: 0; 
}

.category-slide {
    flex: 0 0 25%; /* Show 4 items */
    width: 25%;
    padding: 0 10px;
    box-sizing: border-box;
}

.category-box {
    display: block;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
    height: 100%;
}

.category-image {
    height: 250px; /* Reduced height */
    width: 100%;
    position: relative;
    background: #fff; /* White background for better visibility of transparent images */
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure image fits within container */
    transition: transform 0.5s ease;
}
/* Slider Arrows */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.slider-arrow:hover {
    background: var(--primary-color);
    color: var(--secondary-color);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

@media (max-width: 768px) {
    .category-carousel-container {
        padding: 0 30px; /* Keep some space for arrows */
    }
    
    .category-slide {
        flex: 0 0 160px; /* Override flex-basis for mobile */
        width: 160px; /* Smaller width for mobile */
        padding: 0 5px; /* Reduce gap */
    }
    
    .category-image {
        height: 180px; /* Smaller height for mobile */
    }

    .category-info {
        padding: 10px;
    }
    
    .category-info h3 {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .btn-view {
        padding: 5px 12px;
        font-size: 0.7rem;
    }

    .slider-arrow {
        width: 25px;
        height: 25px;
        font-size: 10px;
        background: rgba(0,0,0,0.6);
    }
    
    .slider-prev {
        left: 2px;
    }
    
    .slider-next {
        right: 2px;
    }
}



.category-box:hover .category-image img {
    transform: scale(1.1);
}

.category-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    text-align: center;
}

.category-info h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-view {
    display: inline-block;
    padding: 8px 20px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    transition: all 0.3s;
}

.category-box:hover .btn-view {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--secondary-color);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-300px * 6)); } /* Adjust based on unique item count */
}

/* Featured Products Styles Adjustment for Canvas */
.featured-products, .combined-section {
    position: relative;
    background: #121212; /* Dark background to make canvas visible */
}

.product-card {
    background: rgba(30, 30, 30, 0.6); /* Semi-transparent to show canvas behind */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.05);
    z-index: 2; /* Ensure card is above canvas */
    position: relative;
}

.section-title, .section-subtitle {
    position: relative;
    z-index: 2;
}

/* Ensure footer and other sections sit above or have proper backgrounds */
.reference-categories, .main-footer {
    position: relative;
    z-index: 2;
    background-color: var(--bg-color);
}

/* Homepage */
.hero-slider {
    position: relative;
    height: 80vh;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
}

.slide.active {
    opacity: 1;
}

.nav-home {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.nav-home a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 30px;
    backdrop-filter: blur(5px);
}
