/* Baron E-Commerce - Main Stylesheet */
:root {
    --primary-color: #FDB931;
    /* Golden color from logo */
    --primary-dark: #C06000;
    --bg-color: #0a0a0b;
    /* Deep Black */
    --card-bg: #161618;
    /* Darker carbon black */
    --text-color: #f2f3f4;
    --text-muted: #a0a0a8;
    --border-color: #2a292d;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --font-family: 'Tajawal', sans-serif;
    --container-width: 1200px;
    --radius: 12px;
    --gold-gradient: linear-gradient(135deg, #FFD700, #FDB931, #C06000, #FFD700);
}

.royal-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out;
}

.royal-crown {
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
    fill: url(#goldGradient);
    /* For SVG */
    filter: drop-shadow(0 0 10px rgba(253, 185, 49, 0.5));
}

.royal-text {
    font-family: 'Cinzel', 'Tajawal', serif;
    font-size: 3.5rem;
    font-weight: 900;
    text-transform: uppercase;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: shine 3s linear infinite;
    letter-spacing: 2px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    /* Shadow on text might conflict with clip, but let's try or rely on filter */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.user-logo-img {
    width: 100px;
    /* Increased from 70px */
    height: 100px;
    /* Increased from 70px */
    border-radius: 50%;
    border: 3px solid #FDB931;
    box-shadow: 0 0 20px rgba(253, 185, 49, 0.6);
    object-fit: cover;
    background: #000;
    transition: transform 0.3s ease;
}

.user-logo-img:hover {
    transform: scale(1.05) rotate(3deg);
}

.header-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #FDB931;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

body.light-mode {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #1d1c26;
    --text-muted: #666;
    --border-color: #ddd;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    direction: rtl;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Baron Logo Style */
.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(45deg, var(--primary-color), #fff, var(--primary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(253, 185, 49, 0.4);
}

.logo-icon {
    font-size: 1.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #000, var(--primary-color));
    color: #fff;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 15px rgba(253, 185, 49, 0.3);
    -webkit-text-fill-color: initial;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius);
    background-color: var(--primary-color);
    color: #000;
    /* Black text on gold */
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-small {
    padding: 0.25rem 0.5rem;
    /* Smaller padding */
    border-radius: 4px;
}

/* Main Layout (Sidebar + Content) */
.main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    /* Align items to top */
}

/* Sidebar Styles */
.sidebar-section {
    flex: 0 0 240px;
    /* Reduced width from 300px */
    position: sticky;
    top: 1rem;
    padding-left: 2rem;
    /* Spacing for the border */
    border-left: 1px solid var(--border-color);
    /* The vertical separator line */
    height: fit-content;
}

/* Search Bar */
.search-container {
    margin-bottom: 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.login-card-side {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(180deg, var(--card-bg), rgba(253, 185, 49, 0.05));
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.login-card-side h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Content Area */
.content-section {
    flex: 1;
    /* Take remaining space */
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    :root {
        --container-width: 95%;
    }
}

@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
        gap: 1.5rem;
    }

    .sidebar-section {
        width: 100%;
        position: static;
        padding-left: 0;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1.5rem;
        margin-bottom: 1rem;
    }

    .hero-slider {
        height: 200px;
    }

    .slide-content h1 {
        font-size: 1.4rem;
    }
}

@media (max-width: 600px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.8rem;
    }

    .hero-slider {
        height: 180px;
    }

    .slide-content h1 {
        font-size: 1.2rem;
        bottom: 15px;
    }

    .product-card {
        padding: 0.8rem;
    }

    .product-card img {
        width: 60px;
        height: 60px;
    }

    .toolbar-inline {
        justify-content: center !important;
        flex-wrap: wrap;
    }

    .currency-bar .container {
        flex-direction: column;
        align-items: center;
        gap: 5px !important;
    }

    .currency-bar div {
        border-right: none !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .royal-text {
        font-size: 2.2rem;
    }

    .user-logo-img {
        width: 80px;
        height: 80px;
    }

    .container {
        padding: 0 0.8rem;
    }
}


/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    /* Remove top margin as it's now inside a container */
    margin: 0;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

.card:hover {
    transform: translateY(-5px);
}

/* Products */
.product-card img {
    border-radius: var(--radius);
    margin-bottom: 1rem;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.price-tag {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.wholesale-badge {
    background: rgba(253, 185, 49, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid rgba(253, 185, 49, 0.2);
}

/* Hero Slider */
.hero-slider {
    position: relative;
    max-width: 100%;
    height: 250px;
    margin-bottom: 2rem;
    overflow: hidden;
    margin-top: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    border: 2px solid #FDB931;
    /* Gold Border */
    background-color: #000;
}

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
    background-size: cover;
    /* Use cover to avoid stretching */
    background-repeat: no-repeat;
    background-color: var(--bg-color);
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    animation: fadeEffect 1s;
    overflow: hidden;
    image-rendering: auto;
    /* Reverted from sharp for smoother look */
    filter: contrast(1.05) brightness(1.05);
    /* Subtle enhancement */
}

.slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Deep Black to Gold Gradient Overlay */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(253, 185, 49, 0.1) 100%);
    z-index: 1;
}

.slide.active {
    display: block;
}

.slide-content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
    padding: 15px;
}

/* Premium Floating Glass Logo */
.slide-content .royal-logo-container {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px;
    border-radius: 50%;
    border: 2px solid rgba(253, 185, 49, 0.6);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: floatingLogo 4s ease-in-out infinite;
}

.slide-content .user-logo-img {
    width: 60px;
    height: 60px;
    border-width: 2px;
}

@keyframes floatingLogo {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.slide-content h1 {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 1.8rem;
    color: #FDB931;
    /* Gold Text */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1), 0 0 15px rgba(253, 185, 49, 0.5);
    font-weight: 800;
    padding: 0 20px;
    letter-spacing: 1px;
}

.slide-content p {
    font-size: 1.4rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    opacity: 0.95;
}

/* Text Animation */
.animate-text {
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
}

@keyframes fadeEffect {
    from {
        opacity: 0.4
    }

    to {
        opacity: 1
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dots */
.slider-dots {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    z-index: 3;
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.dot.active,
.dot:hover {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* Product Icons */
.product-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.product-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
}

.product-card h3 {
    font-size: 1rem;
    margin: 0.5rem 0;
    line-height: 1.3;
}

.product-card .price-tag {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: bold;
}

.product-card .wholesale-badge,
.product-card button {
    display: none;
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

/* Utilities */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-responsive table {
    min-width: 600px;
    /* Force scroll on very small screens if table is wide */
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.hidden {
    display: none !important;
}

/* Switch Toggle Style */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow-y: auto;
    /* Enable scroll on the overlay if content is too tall */
    padding: 20px 0;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 0 auto;
    /* Removed margin-top to use modal padding */
    padding: 1rem;
    border: 1px solid var(--primary-color);
    width: 95%;
    max-width: 360px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    animation: fadeInUp 0.4s ease-out;
    max-height: 90vh;
    /* Don't let it exceed screen height */
    overflow-y: auto;
    /* Scroll inside the card if needed */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

/* Custom Scrollbar for Modal and Webkit Browsers */
.modal-content::-webkit-scrollbar {
    width: 5px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 20px;
}

/* Global scrollbar refinement */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    border: 2px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.close-modal {
    position: absolute;
    left: 0.8rem;
    top: 0.8rem;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    z-index: 10;
}

.recharge-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.form-group label {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.5rem;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: #fff;
    font-family: var(--font-family);
    transition: border-color 0.3s;
    font-size: 0.8rem;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 10px rgba(253, 185, 49, 0.2);
}

.currency-toggle-group {
    display: flex;
    gap: 1rem;
    padding: 0.2rem 0;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.85rem;
}

.radio-group input {
    cursor: pointer;
    accent-color: var(--primary-color);
    width: 14px;
    height: 14px;
}

.file-upload-label {
    border: 1px dashed var(--border-color);
    padding: 0.8rem 0.5rem;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.75rem;
}

.file-upload-label:hover {
    border-color: var(--primary-color);
    background: rgba(253, 185, 49, 0.08);
}

.preview-text {
    font-size: 0.75rem;
    color: var(--success-color);
    margin-top: 0.2rem;
    min-height: 1rem;
    font-weight: 500;
}

/* Admin Notification Badge */
.admin-nav button {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}