/* ============================================
   AL QARAR DIGITAL LIBRARY - MODERN CSS
   Version: 3.0 - Mobile-First, Native App Feel
   ============================================ */

/* ============================================
   1. ROOT VARIABLES
   ============================================ */
:root {
    /* Brand Colors */
    --primary: #1a2a1a;
    --primary-light: #2a3a2a;
    --secondary: #0d1a0d;
    --accent: #D4AF37;
    --accent-hover: #E8C456;
    --accent-rgb: 212, 175, 55;
    
    /* Surface Colors */
    --surface: #ffffff;
    --surface-dark: #1a1a1a;
    --background: #f5f5f5;
    --background-dark: #121212;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-white: #ffffff;
    --text-muted: #9ca3af;
    
    /* Border */
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Spacing (8px system) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Touch Targets (Apple HIG) */
    --touch-min: 44px;
    --touch-comfortable: 48px;
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows - iOS Style */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15), 0 8px 20px rgba(0,0,0,0.08);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Header */
    --header-height: 72px;
    --header-height-mobile: 60px;
    
    /* Bottom Tab Bar */
    --tab-height: 72px;
    --tab-height-mobile: 64px;
}

/* ============================================
   2. RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background);
    padding-top: var(--header-height);
    padding-bottom: calc(var(--tab-height) + 20px);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   3. CONTAINER - FLEXIBLE
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(var(--space-md), 4vw, var(--space-xl));
}

/* ============================================
   4. HEADER - STICKY, WITH SHADOW
   ============================================ */
header {
    background: var(--primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

header.scrolled {
    height: calc(var(--header-height) - 8px);
    box-shadow: var(--shadow-lg);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 var(--space-md);
    gap: var(--space-sm);
}

/* ============================================
   5. LOGO
   ============================================ */
.logo {
    flex-shrink: 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.logo img {
    height: 42px;
    width: auto;
    max-height: 42px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.logo .logo-text {
    color: var(--text-white);
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo .logo-text span {
    color: var(--accent);
}

/* ============================================
   6. NAVIGATION - MOBILE-FRIENDLY
   ============================================ */
.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-xs);
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu li a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    font-size: clamp(13px, 1.1vw, 15px);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    position: relative;
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all var(--transition-base);
    transform: translateX(-50%);
    border-radius: var(--radius-full);
}

.nav-menu li a:hover::after,
.nav-menu li a.active::after {
    width: 60%;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent);
}

/* ============================================
   7. HAMBURGER MENU - MOBILE
   ============================================ */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    min-height: var(--touch-min);
    min-width: var(--touch-min);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.hamburger:hover {
    background: rgba(255,255,255,0.05);
}

.hamburger .bar {
    display: block;
    width: 26px;
    height: 2.5px;
    background: var(--text-white);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    transform-origin: center;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   8. MOBILE NAV OVERLAY
   ============================================ */
.nav-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

.nav-menu-mobile {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--primary);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    transform: translateY(-10px);
    opacity: 0;
    transition: all var(--transition-base);
}

.nav-menu-mobile.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.nav-menu-mobile li {
    list-style: none;
}

.nav-menu-mobile li a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-md);
    color: var(--text-white);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-height: var(--touch-comfortable);
}

.nav-menu-mobile li a i {
    width: 24px;
    color: var(--accent);
    font-size: 18px;
}

.nav-menu-mobile li a:hover,
.nav-menu-mobile li a.active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent);
}

.nav-menu-mobile .nav-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: var(--space-sm) 0;
}

/* ============================================
   9. BOTTOM TAB BAR - NATIVE APP NAVIGATION
   ============================================ */
.bottom-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: var(--space-xs) 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--tab-height);
}

.bottom-tab-bar .tab-items {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: 100%;
}

.bottom-tab-bar .tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-min);
    min-width: 44px;
    padding: var(--space-xs) var(--space-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    flex: 1;
    gap: 1px;
}

.bottom-tab-bar .tab-item i {
    font-size: 22px;
    transition: all var(--transition-fast);
}

.bottom-tab-bar .tab-item span {
    font-size: 10px;
    letter-spacing: 0.3px;
}

.bottom-tab-bar .tab-item.active {
    color: var(--accent);
}

.bottom-tab-bar .tab-item.active i {
    transform: translateY(-1px);
}

.bottom-tab-bar .tab-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent);
    transition: all var(--transition-base);
    transform: translateX(-50%);
    border-radius: 0 0 var(--radius-full) var(--radius-full);
}

.bottom-tab-bar .tab-item.active::after {
    width: 50%;
}

/* Badge for notifications */
.tab-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(calc(50% + 14px));
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ============================================
   10. BUTTONS - TOUCH FRIENDLY (44px min)
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: var(--touch-min);
    min-width: var(--touch-min);
    padding: 0 var(--space-lg);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: clamp(13px, 1.1vw, 15px);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-large {
    min-height: 52px;
    padding: 0 var(--space-2xl);
    font-size: clamp(16px, 1.3vw, 18px);
}

.btn-sm {
    min-height: 36px;
    padding: 0 var(--space-md);
    font-size: clamp(11px, 0.9vw, 13px);
}

.btn-icon {
    width: var(--touch-min);
    height: var(--touch-min);
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
}

/* ============================================
   11. CARDS - MODERN, ROUNDED, WITH SHADOW
   ============================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid var(--border);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card:active {
    transform: scale(0.98);
}

.card-image {
    position: relative;
    padding: var(--space-lg);
    background: var(--border-light);
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base);
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: var(--space-md);
}

.card-title {
    font-size: clamp(15px, 1.2vw, 18px);
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: clamp(12px, 0.9vw, 14px);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.card-price {
    font-size: clamp(16px, 1.3vw, 20px);
    font-weight: 700;
    color: var(--accent);
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* Card Overlay (hover effect) */
.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 42, 26, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-base);
    border-radius: var(--radius-md);
    margin: var(--space-lg);
}

.card:hover .card-overlay {
    opacity: 1;
}

.card-overlay .btn {
    transform: translateY(10px);
    transition: all var(--transition-bounce);
}

.card:hover .card-overlay .btn {
    transform: translateY(0);
}

/* ============================================
   12. GRID - RESPONSIVE
   ============================================ */
.grid {
    display: grid;
    gap: var(--space-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ============================================
   13. USER DROPDOWN - MODERN
   ============================================ */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    cursor: pointer;
    padding: 4px var(--space-md) 4px 4px;
    min-height: 44px;
    transition: all var(--transition-fast);
}

.user-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    background: var(--primary-light);
}

.user-name {
    color: var(--text-white);
    font-weight: 500;
    font-size: 13px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chevron {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    transition: transform var(--transition-base);
}

.user-btn.active .user-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

/* Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--surface);
    min-width: 220px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideDown 0.25s ease;
    border: 1px solid var(--border);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    min-height: 48px;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a i {
    width: 20px;
    color: var(--accent);
    font-size: 16px;
}

.dropdown-menu a:hover {
    background: #fefaf0;
    color: var(--accent);
}

.dropdown-menu a.logout {
    color: #dc3545;
    border-top: 1px solid var(--border);
}

.dropdown-menu a.logout i {
    color: #dc3545;
}

.dropdown-menu a.logout:hover {
    background: #fef2f2;
}

/* ============================================
   14. LANGUAGE SELECTOR
   ============================================ */
.language-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    color: var(--text-white);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    min-height: 40px;
    transition: all var(--transition-fast);
}

.lang-btn:hover {
    background: rgba(255,255,255,0.1);
}

.lang-flag { font-size: 18px; }
.lang-name { font-size: 13px; font-weight: 500; }
.lang-chevron { font-size: 10px; transition: transform var(--transition-base); }

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    min-width: 160px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: var(--space-xs) 0;
    border: 1px solid var(--border);
    animation: slideDown 0.2s ease;
}

.lang-menu.show { display: block; }

.lang-menu li a {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
    min-height: 40px;
}

.lang-menu li a:hover {
    background: #fefaf0;
    color: var(--accent);
}

.lang-menu li.active a {
    background: #fefaf0;
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   15. SEARCH BAR
   ============================================ */
.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-md);
    transition: all var(--transition-fast);
    min-width: 180px;
}

.search-bar:focus-within {
    background: rgba(255,255,255,0.15);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-white);
    font-size: 13px;
    padding: var(--space-sm) 0;
    width: 100%;
}

.search-bar input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-bar button {
    background: var(--accent);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
    font-size: 12px;
    min-height: 36px;
    transition: all var(--transition-fast);
}

.search-bar button:hover {
    background: var(--accent-hover);
}

/* ============================================
   16. FORMS
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.form-group .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--surface);
    color: var(--text-primary);
    min-height: var(--touch-min);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: var(--space-xs);
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   17. ALERTS & NOTIFICATIONS
   ============================================ */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideDown 0.3s ease;
    border-left: 4px solid transparent;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left-color: #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left-color: #f59e0b;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left-color: #3b82f6;
}

/* ============================================
   18. TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: calc(var(--tab-height) + 20px);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 400px;
    width: 100%;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    animation: slideInRight 0.4s ease;
    border-left: 4px solid var(--accent);
}

.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }
.toast-info { border-left-color: #3b82f6; }

.toast i { font-size: 20px; }
.toast-success i { color: #10b981; }
.toast-error i { color: #ef4444; }
.toast-warning i { color: #f59e0b; }
.toast-info i { color: #3b82f6; }

/* ============================================
   19. SKELETON LOADING
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--border-light) 25%,
        var(--border) 50%,
        var(--border-light) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   20. UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }

.rounded { border-radius: var(--radius-md); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ============================================
   21. RESPONSIVE BREAKPOINTS
   ============================================ */

/* --- Tablets & Small Desktops --- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-auto { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .container { padding: 0 var(--space-md); }
}

/* --- Mobile Devices --- */
@media (max-width: 768px) {
    :root {
        --header-height: var(--header-height-mobile);
        --tab-height: var(--tab-height-mobile);
        --touch-min: 48px;
    }
    
    body {
        padding-top: var(--header-height);
        padding-bottom: calc(var(--tab-height) + 16px);
    }
    
    /* Desktop nav hidden */
    .nav-menu {
        display: none !important;
    }
    
    /* Hamburger visible */
    .hamburger {
        display: flex;
    }
    
    /* Bottom tab bar visible */
    .bottom-tab-bar {
        display: block;
    }
    
    /* Grid adjustments */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-auto {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    /* Card adjustments */
    .card-image {
        padding: var(--space-md);
        min-height: 140px;
    }
    
    .card-image img {
        max-width: 120px;
    }
    
    .card-overlay {
        margin: var(--space-md);
        border-radius: var(--radius-sm);
    }
    
    /* Buttons full width on mobile */
    .btn-block-mobile {
        width: 100%;
        justify-content: center;
    }
    
    /* Hide user name on mobile */
    .user-name {
        display: none;
    }
    
    .user-btn {
        padding: 4px 8px 4px 4px;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    /* Language selector compact */
    .lang-name {
        display: none;
    }
    
    .lang-btn {
        padding: 6px 10px;
    }
    
    /* Search bar */
    .search-bar {
        min-width: 120px;
    }
    
    .search-bar input {
        font-size: 12px;
    }
    
    .search-bar button {
        padding: var(--space-xs) var(--space-sm);
        font-size: 11px;
    }
    
    /* Toast */
    .toast-container {
        right: var(--space-md);
        left: var(--space-md);
        bottom: calc(var(--tab-height) + 16px);
        max-width: none;
    }
}

/* --- Small Phones --- */
@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .grid-auto {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .card-image img {
        max-width: 100px;
    }
    
    .container {
        padding: 0 var(--space-sm);
    }
    
    .logo img {
        height: 32px;
    }
    
    .logo .logo-text {
        font-size: 14px;
    }
    
    .bottom-tab-bar .tab-item i {
        font-size: 18px;
    }
    
    .bottom-tab-bar .tab-item span {
        font-size: 8px;
    }
}

/* ============================================
   22. ANIMATIONS
   ============================================ */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   23. PRINT STYLES
   ============================================ */
@media print {
    .bottom-tab-bar,
    .nav-overlay,
    .nav-menu-mobile,
    .hamburger,
    .user-dropdown,
    .language-selector {
        display: none !important;
    }
    
    body {
        padding: 0 !important;
        background: white !important;
    }
    
    header {
        position: relative !important;
        height: auto !important;
        box-shadow: none !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ============================================
   24. DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --background: var(--background-dark);
        --surface: #1e1e1e;
        --text-primary: #e5e7eb;
        --text-secondary: #9ca3af;
        --border: #2d2d2d;
        --border-light: #2a2a2a;
    }
    
    .card {
        background: #1e1e1e;
    }
    
    .dropdown-menu {
        background: #1e1e1e;
    }
    
    .dropdown-menu a {
        color: #e5e7eb;
        border-color: #2d2d2d;
    }
    
    .dropdown-menu a:hover {
        background: #2a2a2a;
    }
    
    .bottom-tab-bar {
        background: #1e1e1e;
        border-color: #2d2d2d;
    }
    
    .toast {
        background: #1e1e1e;
        color: #e5e7eb;
    }
}

/* ============================================
   25. CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--border-light);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ============================================
   26. FOCUS VISIBLE (Accessibility)
   ============================================ */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ============================================
   27. REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}