/* Reset and Basic Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    scroll-behavior: smooth;
    transition: background-color 0.3s, color 0.3s;
}

/* --- Header & Navigation --- */

header {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e88e5;
    transition: color 0.3s;
}

/* --- Stylish Menu Button (Ultra-Modern Look) --- */
.menu-btn {
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid #00bcd4; /* Bright Cyan/Aqua Ring */
    font-size: 1.5rem; 
    cursor: pointer;
    color: #00bcd4;
    width: 50px;
    height: 50px;
    border-radius: 50%; 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.menu-btn:hover {
    background-color: #00bcd4;
    color: white;
    border-color: #00bcd4;
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* --- Sidebar Navigation (Slides down from the top-right) --- */
#sideMenu {
    position: fixed;
    right: 0; /* Anchor to the right edge */
    top: -100%; /* Hidden off-screen above the viewport */
    
    width: 280px;
    height: 100%;
    
    background-color: rgba(18, 18, 18, 0.98); 
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    
    transition: top 0.4s ease-in-out; /* Transition 'top' property */
    
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 30px 20px;
}

#sideMenu.active {
    top: 0; /* Slides down to the top edge */
}

.close-btn {
    align-self: flex-end;
    background: none;
    border: none;
    color: #ff5252;
    font-size: 2.2rem; 
    cursor: pointer;
    margin-bottom: 35px; 
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ff1744;
}

#sideMenu ul {
    list-style: none;
    flex-grow: 1;
    padding-top: 15px; 
}

#sideMenu li a {
    color: #ffffff; 
    text-decoration: none;
    display: flex; 
    align-items: center;
    padding: 14px 15px; 
    margin-bottom: 8px;
    font-size: 1.05rem;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.1s;
}

#sideMenu li a i {
    margin-right: 18px; 
    font-size: 1.2rem;
    color: #00e5ff; 
}

#sideMenu li a:hover {
    background-color: #2a2a2a; 
    transform: translateX(3px); 
}

/* Login Box */
.login-box {
    padding-top: 30px; 
    border-top: 1px solid rgba(255, 255, 255, 0.1); 
}

.login-box input {
    width: 100%;
    padding: 12px; 
    margin-bottom: 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #2a2a2a; 
    color: white;
}

/* --- Theme Toggle Switch Style (Unique Icon Look) --- */
.theme-switch-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 10px;
    margin-top: 30px; 
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    font-weight: 500;
    color: #e0e0e0;
}

/* The actual switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Basic styling for the slider */
.slider {
    max-width: 1000px; /* Apnar proyojon moto adjust korun */
    position: relative;
    margin: auto;
    overflow: hidden; /* Important for clean display */
}

/* Container for all slides */
.slides-container {
    width: 100%;
    height: 500px; /* Chobir size fix korar jonno (adjust korun) */
    position: relative;
}

/* Individual slide styling */
.slide {
    display: none; /* By default, all slides are hidden */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Image styling */
.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures images cover the area without stretching */
}

/* Fade animation for transition */
.fade {
    /* CSS transition for smooth opacity change */
    transition: opacity 1.5s ease-in-out; /* 1.5 seconds aalo-adhari effect */
    opacity: 0; /* Hidden state */
}

/* When a slide is active (shown) */
.slide.active {
    display: block; /* Show the active slide */
    opacity: 1; /* Fully visible */
}

/* Dot navigation styling (optional, but good practice) */
.dot {
    height: 15px;
    width: 15px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.6s ease;
}

.dot.active-dot {
    background-color: #717171;
}

.dot-navigation {
    text-align: center;
    padding: 10px 0;
    position: absolute;
    bottom: 10px;
    width: 100%;
}
/* ICONS (Moon & Sun) STYLING */
.slider i {
    position: absolute;
    font-size: 14px;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.4s;
    pointer-events: none;
    z-index: 2;
}

/* Sun Icon (Right side, visible in Light Mode) */
.sun-icon {
    right: 8px;
    color: #ffeb3b;
    opacity: 1; 
}

/* Moon Icon (Left side, hidden in Light Mode) */
.moon-icon {
    left: 8px;
    color: #cfd8dc;
    opacity: 0; 
}

/* When the checkbox is CHECKED (Dark Mode ON) */
input:checked + .slider {
    background-color: #00bcd4; /* Bright Aqua ON color */
}

/* Move the circle to the right when checked */
input:checked + .slider:before {
    transform: translateX(26px);
}

/* Hide Sun, Show Moon when checked (Dark Mode ON) */
input:checked + .slider .sun-icon {
    opacity: 0;
}

input:checked + .slider .moon-icon {
    opacity: 1;
}

/* --- Buttons --- */
.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.1s;
}

.btn-primary {
    background-color: #1e88e5;
    color: white;
}

.btn-primary:hover {
    background-color: #1565c0;
}

.btn-login {
    background-color: #27ae60;
    color: white;
    width: 100%;
}

.btn-login:hover {
    background-color: #2ecc71;
}

.btn-add-cart {
    background-color: #f39c12;
    color: white;
    width: 100%;
    margin-top: 10px;
}

.btn-add-cart:hover {
    background-color: #e67e22;
}

.btn-print {
    background-color: #27ae60;
    color: white;
}

.btn-clear {
    background-color: #e74c3c;
    color: white;
}

/* NEW: Delete Button Style */
.btn-danger {
    background-color: #dc3545; 
    color: white;
    border: none;
    padding: 12px 18px; 
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}


/* --- Slider Section --- */
.slider {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    height: 350px; 
}

.slides-container {
    display: flex;
    width: 500%; 
    transition: transform 0.5s ease-in-out;
}

.slide {
    width: 20%;
    flex-shrink: 0;
}

.slide img {
    width: 100%;
    height: 350px;
    object-fit: cover; 
}

.dot-navigation {
    text-align: center;
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.dot {
    height: 10px;
    width: 10px;
    margin: 0 4px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
    cursor: pointer;
}

.dot.active {
    background-color: #1e88e5;
}

/* --- Main Content Layout --- */

.main-content, .owner-panel, .invoice-section, .about-section, .contact-section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3 { /* Added h3 */
    color: #1e88e5;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
    transition: color 0.3s;
}

/* --- Owner Panel --- */

.owner-panel {
    background-color: #ecf0f1;
    border-radius: 8px;
    margin-bottom: 30px;
    display: none;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.owner-panel.active {
    display: block;
}

.panel-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.panel-controls input {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    flex: 1 1 200px;
    background-color: white;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* NEW: Delete Controls Styling */
.panel-controls.delete-controls {
    display: flex; 
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
}

/* NEW: Separator Line */
.panel-separator {
    border: 0;
    height: 1px;
    background-color: #ccc;
    margin: 20px 0;
    width: 80%; 
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.3s;
}

/* --- Product Grid --- */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.product-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.product-card h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 10px;
}

.product-card p {
    margin-bottom: 5px;
}

.product-card .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e74c3c;
    margin: 10px 0;
}

.product-card .stock {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.product-card input[type="number"] {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: white;
}

/* --- Invoice Section --- */

.invoice-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.customer-info-box {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.customer-info-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: white;
}

#invoiceDetails {
    min-height: 100px;
    border: 1px dashed #ccc;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    transition: border-color 0.3s;
}

.empty-cart-message {
    text-align: center;
    color: #95a5a6;
    padding: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.invoice-summary {
    text-align: right;
    padding-top: 15px;
    border-top: 2px solid #333;
    transition: border-top-color 0.3s;
}

/* NEW: Remove Item button in cart */
.remove-item-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    transition: color 0.2s;
}
.remove-item-btn:hover {
    color: #c0392b;
}


/* --- About and Contact Section --- */
.about-card {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: background-color 0.3s, box-shadow 0.3s, border 0.3s;
}

.contact-icons {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.icon-link {
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1rem;
    transition: color 0.3s;
}

.icon-link:hover {
    color: #1e88e5;
}

/* --- Footer --- */

.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    transition: background-color 0.3s;
}

/* ========================================================= */
/* --- ✨ DARK MODE STYLES --- */
/* ========================================================= */

body.dark-theme {
    background-color: #121212; 
    color: #e0e0e0; 
}

.dark-theme header {
    background-color: #1e1e1e;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

.dark-theme .logo {
    color: #4db6ac;
}

.dark-theme .menu-btn {
    background-color: #4db6ac;
    color: #1e1e1e;
}
.dark-theme .menu-btn:hover {
    background-color: #26a69a;
}

.dark-theme h1, .dark-theme h2, .dark-theme h3 { /* Added h3 */
    color: #4db6ac;
}

.dark-theme .owner-panel,
.dark-theme .product-card, 
.dark-theme .invoice-section,
.dark-theme .about-card {
    background-color: #1e1e1e;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.dark-theme .panel-separator { /* NEW */
    background-color: #444;
}

.dark-theme .btn-danger { /* NEW */
    background-color: #c0392b;
}

.dark-theme .btn-danger:hover {
    background-color: #e74c3c;
}


.dark-theme .product-card h3,
.dark-theme .product-card p {
    color: #e0e0e0;
}

.dark-theme .product-card .price {
    color: #ff9800;
}

.dark-theme .product-card .stock {
    color: #95a5a6;
}
.dark-theme .product-card .stock span {
    color: #ff9800 !important;
}

/* Dark Mode Inputs */
.dark-theme input[type="text"],
.dark-theme input[type="number"],
.dark-theme input[type="password"] {
    background-color: #333;
    color: #e0e0e0;
    border: 1px solid #555;
}
.dark-theme input::placeholder {
    color: #aaa;
}

.dark-theme #invoiceDetails {
    border: 1px dashed #555;
}

.dark-theme .cart-item {
    border-bottom: 1px solid #444;
}

.dark-theme .invoice-summary {
    border-top: 2px solid #555;
}

.dark-theme .contact-section .icon-link {
    color: #e0e0e0;
}
.dark-theme .contact-section .icon-link:hover {
    color: #4db6ac;
}

.dark-theme .footer {
    background-color: #1e1e1e;
}

/* --- Print Styling (For Invoice) --- */
@media print {
    body * {
        visibility: hidden;
    }
    #invoice, #invoice * {
        visibility: visible;
    }
    #invoice {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
    }
    .invoice-actions, .customer-info-box input:last-child { 
        display: none !important;
    }
    .invoice-container {
        box-shadow: none !important;
    }
    #invoiceDetails {
        border: 1px solid #333 !important;
    }
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
    header {
        padding: 10px 15px;
    }
    .logo {
        font-size: 1.5rem;
    }
    .slider {
        height: 250px;
    }
    .slide img {
        height: 250px;
    }
    .owner-panel, .invoice-section, .about-section, .contact-section {
        padding: 20px 15px;
    }
    .customer-info-box {
        flex-direction: column;
        gap: 10px;
    }
    .invoice-actions {
        flex-direction: column;
    }
    .invoice-actions .btn {
        width: 100%;
    }
    /* NEW: Responsive delete controls */
    .panel-controls.delete-controls {
        flex-direction: column;
    }
    .panel-controls.delete-controls input {
        width: 100%;
    }
}