@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg: #0d0f14;
    --surface: #161920;
    --surface2: #1e2230;
    --surface3: #252a3d;
    --border: #2a2f3d;
    --border-light: #3d4458;
    --accent: #00d4aa;
    --accent2: #ff6b35;
    --accent3: #7c5cfc;
    --text: #e8eaf0;
    --text-secondary: #94a3b8;
    --muted: #6b7280;
    --success: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --shadow: rgba(0, 0, 0, 0.4);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface2: #f1f5f9;
    --surface3: #e2e8f0;
    --border: #cbd5e1;
    --border-light: #e2e8f0;
    --text: #0f172a;
    --text-secondary: #475569;
    --muted: #64748b;
    --shadow: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ========== HEADER ========== */
.main-header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 15, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
}

[data-theme="light"] .main-header {
    background: rgba(248, 250, 252, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
    width: 100%;
}

/* Remove underline from back button */
.btn-outline {
    text-decoration: none !important;
}

/* Modern Select Styling */
.modern-select-wrapper {
    position: relative;
    min-width: 200px;
}

.modern-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
}

.modern-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.modern-select-wrapper::after {
    content: '▼';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 0.8rem;
    pointer-events: none;
}

/* Light mode */
[data-theme="light"] .modern-select {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

[data-theme="light"] .modern-select:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Auth loading */
#authLoading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1rem;
}

#authLoading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.access-denied {
    text-align: center;
    padding: 3rem;
}

.access-denied h2 {
    color: var(--danger);
    margin-bottom: 1rem;
}

/* Header Left - الزرارين */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    perspective: 1000px;
    /* مهم للـ 3D */
}

/* Reset links */
a {
    text-decoration: none;
    font: inherit;
    color: inherit;
}

/* Form improvements */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.glass-input {
    width: 100%;
    padding: 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: white;
    transition: all 0.2s ease;
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

textarea.glass-input {
    resize: none;
}

/* Button enhancement */
.btn-accent {
    transition: all 0.25s ease;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.25);
}

/* Card hover */
.form-section {
    transition: 0.3s;
}

.form-section:hover {
    transform: translateY(-4px);
}

/* Fade animation */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== GLASS TOGGLE BUTTON (للزرارين) ========== */
#themeToggle .light-icon,
#themeToggle .dark-icon {
    display: none !important;
}

[data-theme="dark"] #themeToggle .dark-icon,
[data-theme="light"] #themeToggle .light-icon {
    display: inline-flex !important;
}

.btn-glass-toggle {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 140px;
    height: 40px;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-glass-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    transform: translateZ(30px);
    /* max 30px */
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 10px 20px rgba(0, 212, 170, 0.2);
}

/* Theme Toggle - اظهار/اخفاء الايقونات */
#themeToggle .light-icon,
#themeToggle .dark-icon {
    display: none;
}

[data-theme="dark"] #themeToggle .light-icon {
    display: inline;
}

[data-theme="light"] #themeToggle .dark-icon {
    display: inline;
}

/* Availability Toggle - النص والايقونة */
#availabilityToggle .toggle-icon {
    display: none;
}

#availabilityToggle.active .toggle-text {
    display: none;
}

#availabilityToggle.active .toggle-icon {
    display: inline-flex;
    font-size: 1.2rem;
}

#availabilityToggle.active {
    min-width: 40px;
    width: 40px;
    padding: 0;
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    transform: translateZ(30px);
    box-shadow:
        0 20px 40px rgba(0, 212, 170, 0.4),
        0 10px 20px rgba(0, 212, 170, 0.3);
}

#availabilityToggle.active:hover {
    box-shadow:
        0 25px 50px rgba(0, 212, 170, 0.5),
        0 15px 30px rgba(0, 212, 170, 0.4);
}

/* الـ Theme Toggle يبقى مربع صغير */
#themeToggle {
    min-width: 40px;
    width: 40px;
    padding: 0;
}

/* ========== LIGHT MODE ========== */
[data-theme="light"] .btn-glass-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

[data-theme="light"] .btn-glass-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--accent);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.2),
        0 10px 20px rgba(0, 212, 170, 0.15);
}

[data-theme="light"] #availabilityToggle.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow:
        0 20px 40px rgba(0, 212, 170, 0.3),
        0 10px 20px rgba(0, 212, 170, 0.2);
}

/* Admin Quick Links */
.admin-quick-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.btn-purple {
    background: linear-gradient(135deg, #7c5cfc 0%, #a855f7 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(124, 92, 252, 0.3);
}

.btn-purple:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 92, 252, 0.4);
    filter: brightness(1.1);
}

.btn-requests {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
    border: 1px solid rgba(255, 107, 53, 0.3);
}

.btn-requests:hover {
    background: rgba(255, 107, 53, 0.2);
    border-color: #ff6b35;
    transform: translateY(-2px);
}

[data-theme="light"] .requests-badge {
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* ========== BRAND & LOGIN ========== */
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    height: 70px;
    width: auto;
    flex-shrink: 0;
}

.brand h1 {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.btn-login {
    background: linear-gradient(135deg, var(--accent3), #5c5fff);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(124, 92, 252, 0.3);
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 92, 252, 0.4);
}

body.is-admin .btn-login {
    display: none !important;
}

/* ========== ADMIN PANEL ========== */
.admin-panel {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--card-shadow);
}

.panel-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

/* User Section في الهيدر */
.user-section {
    position: absolute;
    top: 0;
    left: 0;
}

.panel-header h2 {
    color: var(--accent);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface2);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);
}

.btn-accent {
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    color: white;
    border: none;
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 170, 0.4);
    filter: brightness(1.1);
}

.btn-outline {
    background: linear-gradient(135deg, #7c5cfc 0%, #5c5fff 100%);
    color: white;
    border: none;
}

.btn-outline:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(124, 92, 252, 0.4);
    filter: brightness(1.1);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: var(--danger);
}

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

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.admin-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent3));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
    transition: all 0.3s ease;
}

.admin-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    /* ← عشان يظهر على اليسار */
    right: auto;
    /* ← مش على اليمين */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    min-width: 240px;
    box-shadow: var(--hover-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Links */
.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.dropdown-item:hover {
    background: var(--surface2);
    border-color: var(--accent);
    transform: translateX(-5px);
    color: var(--accent);
}

.dropdown-item .icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
}

/* Fire Badge */
.badge-fire {
    margin-right: auto;
    /* ← يوديه على اليمين في RTL */
    margin-left: 0;
    background: linear-gradient(135deg, #ff6b35, #ff4757);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    animation: pulse-fire 2s infinite;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

@keyframes pulse-fire {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Divider */
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

/* Logout Button in Dropdown */
.dropdown-menu .btn-logout {
    width: 100%;
    margin-top: 0;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* Admin Controls المسافة من فوق */
.admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
    /* ← مسافة من الـ panel-header */
    padding-top: 1rem;
}

#accessDenied {
    /* Centering */
    display: flex;
    /* Note: This overrides the 'hidden' class display:none when shown */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Full viewport height */
    text-align: center;

    /* Styling */
    background: #f8f9fa;
    padding: 2rem;
    gap: 1rem;
    /* Space between elements */
}

/* Handle the hidden class properly */
#accessDenied.hidden {
    display: none !important;
}

/* When not hidden, ensure it's flex */
#accessDenied:not(.hidden) {
    display: flex;
}

/* Style the elements */
#accessDenied h2 {
    color: #dc3545;
    font-size: 2.5rem;
    margin: 0;
}

#accessDenied p {
    color: #6c757d;
    font-size: 1.2rem;
    max-width: 500px;
    margin: 0;
}

#accessDenied .btn {
    margin-top: 1rem;
    font-weight: bold;
    text-decoration: none;
    padding: 0.75rem 2rem;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Filters */
.filters-section {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
    align-items: center;
    justify-content: space-between;
    background: rgba(22, 25, 32, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.25rem;
}

[data-theme="light"] .filters-section {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.search-container {
    flex: 1;
    max-width: 600px;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .search-input {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.select-input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    min-width: 150px;
}

.view-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    height: 40px;
}

.view-btn {
    padding: 0 0.75rem;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-btn.active {
    background: var(--surface2);
    color: var(--accent);
}

.view-btn:hover:not(.active) {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

/* Stats */
.stats-bar {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(22, 25, 32, 0.5);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin: 0 2rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

[data-theme="light"] .stats-bar {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

/* Product Card */
.product-card {
    background: rgba(22, 25, 32, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .product-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 212, 170, 0.3);
}

[data-theme="light"] .product-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 212, 170, 0.5);
}

.card-actions {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

body:not(.is-admin) .card-actions {
    display: none;
}

.card-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(13, 15, 20, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

[data-theme="light"] .card-action-btn {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-action-btn.edit {
    color: var(--accent);
}

.card-action-btn.delete {
    color: var(--danger);
}

.card-action-btn:hover {
    transform: scale(1.1);
}

.card-image-container {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--surface2), var(--surface3));
    position: relative;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--surface2), var(--surface3));
    color: var(--muted);
}

.category-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(13, 15, 20, 0.8);
    backdrop-filter: blur(8px);
    color: var(--accent);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--border);
}

[data-theme="light"] .category-badge {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin: 0;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.price-tag {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-main {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent);
}

.price-secondary {
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: line-through;
}

.qty-badge {
    background: var(--surface2);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid var(--border);
}

.qty-low {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.qty-high {
    color: var(--success);
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

/* List View */
.list-view .product-card {
    flex-direction: row;
    height: auto;
}

.list-view .card-image-container {
    width: 200px;
    height: 150px;
    flex-shrink: 0;
}

.list-view .card-content {
    flex: 1;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.list-view .card-title {
    flex: 1;
}

.list-view .card-meta {
    margin-top: 0;
    border-top: none;
    min-width: 200px;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--text);
}

.close-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close-btn:hover {
    background: var(--surface2);
    color: var(--danger);
}

.modal-form {
    padding: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-row {
    display: contents;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-group small {
    color: var(--muted);
    font-size: 0.75rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.spacer {
    flex: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2;

    color: var(--muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: var(--hover-shadow);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.toast.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.toast.warning {
    border-color: var(--warn);
    background: rgba(245, 158, 11, 0.1);
    color: var(--warn);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.pagination .btn {
    min-width: 100px;
    height: 40px;
    font-size: 0.9rem;
}

.page-info {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1rem;
    min-width: 120px;
    text-align: center;
}

.pagination .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Footer */

.main-footer {

    margin-top: 3rem;

    background: var(--surface);

    border-top: 1px solid var(--border);

    padding: 2rem 0 0;

}

.footer-content {

    max-width: 1400px;

    margin: 0 auto;

    padding: 0 2rem;

    display: grid;

    grid-template-columns: 1fr 1fr 1fr;

    gap: 2rem;

}

.footer-section h3 {

    color: var(--accent);

    font-size: 1.1rem;

    margin-bottom: 1rem;

    display: flex;

    align-items: center;

    gap: 0.5rem;

}

/* Map Section */

.map-link {

    display: block;

    text-decoration: none;

    color: var(--text);

    transition: all 0.3s ease;

}

.map-preview {

    position: relative;

    border-radius: 12px;

    overflow: hidden;

    margin-bottom: 0.75rem;

    border: 1px solid var(--border);

}

.map-overlay {

    position: absolute;

    top: 0;

    left: 0;

    right: 0;

    bottom: 0;

    background: rgba(0, 0, 0, 0.6);

    display: flex;

    align-items: center;

    justify-content: center;

    opacity: 0;

    transition: opacity 0.3s ease;

}

.map-overlay span {

    background: var(--accent);

    color: var(--bg);

    padding: 0.5rem 1rem;

    border-radius: 20px;

    font-size: 0.85rem;

    font-weight: 600;

}

.map-link:hover .map-overlay {

    opacity: 1;

}

.address {

    font-size: 0.9rem;

    color: var(--text-secondary);

    line-height: 1.6;

}

/* Links Section */

.footer-links ul {

    list-style: none;

    display: flex;

    flex-direction: column;

    gap: 0.75rem;

}

.footer-link {

    display: flex;

    align-items: center;

    gap: 0.5rem;

    padding: 0.75rem 1rem;

    background: var(--surface2);

    border: 1px solid var(--border);

    border-radius: 10px;

    color: var(--text);

    text-decoration: none;

    transition: all 0.3s ease;

    position: relative;

}

.footer-link:hover {

    background: var(--surface3);

    border-color: var(--accent);

    transform: translateY(-2px);

    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.2);

}

.footer-link .icon {

    font-size: 1.2rem;

}

/* Hiring Badge */

.hiring-badge {

    margin-right: auto;

    display: flex;

    align-items: center;

    gap: 0.4rem;

    background: rgba(34, 197, 94, 0.15);

    color: var(--success);

    padding: 0.25rem 0.75rem;

    border-radius: 20px;

    font-size: 0.75rem;

    font-weight: 700;

    border: 1px solid var(--success);

}

.pulse-dot {

    width: 8px;

    height: 8px;

    background: var(--success);

    border-radius: 50%;

    animation: pulse 2s infinite;

}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }

}

/* Contact Section */

.phone-list {

    display: flex;

    flex-direction: column;

    gap: 0.75rem;

}

.phone-item {

    display: flex;

    align-items: center;

    gap: 0.75rem;

    padding: 0.75rem 1rem;

    background: var(--surface2);

    border: 1px solid var(--border);

    border-radius: 10px;

    transition: all 0.3s ease;

}

.phone-item:hover {

    background: var(--surface3);

    border-color: var(--accent);

    transform: translateX(-5px);

}

.phone-icon {

    font-size: 1.2rem;

}

.phone-link {

    color: var(--text);

    text-decoration: none;

    font-weight: 600;

    font-family: 'JetBrains Mono', monospace;

    font-size: 0.95rem;

    direction: ltr;

    display: inline-block;

}

.phone-link:hover {

    color: var(--accent);

}

/* Footer Bottom */

.footer-bottom {

    margin-top: 2rem;

    padding: 1.5rem;

    text-align: center;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 0.85rem;

}

/* Responsive Mobile */
@media (max-width: 768px) {
    .main-header {
        padding: 0.5rem 1rem;
    }

    .header-content {
        gap: 0.5rem;
    }

    .logo-img {
        height: 34px;
    }

    .brand h1 {
        font-size: 14px;
        white-space: normal;
        line-height: 1.2;
    }

    .brand {
        gap: 0.5rem;
    }

    .header-left {
        gap: 0.5rem;
    }

    /* Glass Toggle Mobile */
    .btn-glass-toggle {
        min-width: 40px;
        width: 40px;
        padding: 0;
        font-size: 1rem;
    }

    .btn-glass-toggle .toggle-text {
        display: none;
    }

    #availabilityToggle:not(.active) .toggle-icon {
        display: inline-flex;
    }

    #themeToggle {
        min-width: 40px;
        width: 40px;
        padding: 0;
    }

    .btn-login {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .filters-section {
        margin: 0.75rem 1rem;
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    .products-grid {
        padding: 1rem;
        gap: 1rem;
        grid-template-columns: 1fr;
    }

    .admin-panel {
        margin: 0.75rem 1rem;
        padding: 1rem;
    }

    .admin-controls {
        flex-direction: column;
        width: 100%;
    }

    .admin-controls .btn {
        width: 100%;
        justify-content: center;
    }

    .list-view .product-card {
        flex-direction: row;
        /* يفضل صف مش عمود */
        height: 90px;
        /* ارتفاع ثابت صغير */
        min-height: 90px;
    }

    .list-view .card-image-container {
        width: 90px;
        /* عرض ثابت للصورة */
        height: 100%;
        /* تملا الارتفاع */
        flex-shrink: 0;
    }

    .list-view .card-image,
    .list-view .image-placeholder {
        height: 100%;
    }

    .list-view .card-content {
        flex-direction: row;
        /* صف */
        align-items: center;
        gap: 0.75rem;
        padding: 0.5rem 0.75rem;
        overflow: hidden;
        flex: 1;
    }

    .list-view .card-title {
        font-size: 0.85rem;
        /* خط أصغر */
        line-height: 1.3;
        white-space: nowrap;
        /* سطر واحد */
        overflow: hidden;
        text-overflow: ellipsis;
        /* ... لو طويل */
        flex: 1;
        margin: 0;
    }

    .list-view .card-meta {
        flex-direction: column;
        /* السعر والكمية فوق بعض */
        align-items: flex-end;
        justify-content: center;
        min-width: auto;
        gap: 0.25rem;
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }

    .list-view .price-tag {
        gap: 0.1rem;
    }

    .list-view .price-main {
        font-size: 0.9rem;
        /* سعر أصغر */
        font-weight: 700;
    }

    .list-view .price-secondary {
        font-size: 0.7rem;
    }

    .list-view .qty-badge {
        font-size: 0.7rem;
        padding: 0.1rem 0.4rem;
    }

    /* اخفاء الـ actions في الموبايل لو مش admin */
    .list-view .card-actions {
        position: static;
        flex-direction: row;
        gap: 0.25rem;
        margin-left: 0.5rem;
    }

    .list-view .card-action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .spacer {
        display: none;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast {
        min-width: auto;
    }

    .stats-bar {
        margin: 0 1rem;
    }

    .card-actions {
        opacity: 1;
    }

    .pagination {
        gap: 0.75rem;
        padding: 1rem;
    }

    .pagination .btn {
        min-width: 80px;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .page-info {
        font-size: 0.85rem;
        min-width: 100px;
    }

    .footer-content {

        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .footer-section h3 {

        font-size: 1rem;
    }

    .map-preview iframe {

        height: 200px;
    }

}