/* Categories Mobile Enhancement CSS - Simplified */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #8b5cf6;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* RTL Support for Arabic */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .search-container {
    direction: rtl;
}

[dir="rtl"] .search-container .flex-1 input {
    text-align: right;
    padding-right: 1rem;
    padding-left: 2.5rem;
}

[dir="rtl"] .categories-grid {
    direction: rtl;
}

[dir="rtl"] .category-card {
    text-align: right;
}

[dir="rtl"] .category-card .flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .category-card .text-left {
    text-align: right;
}

[dir="rtl"] .category-card .text-right {
    text-align: left;
}

[dir="rtl"] .item-card {
    text-align: right;
}

/* [dir="rtl"] .item-card .flex {
    flex-direction: row-reverse;
} */

[dir="rtl"] .nutritional-tag {
    direction: ltr;
    text-align: center;
}

[dir="rtl"] .stat-card {
    text-align: center;
}

[dir="rtl"] .category-stats .flex {
    flex-direction: row-reverse;
}

/* Arabic Font Support */
body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.category-name,
.item-name,
.item-description {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    line-height: 1.6;
}

/* Categories Grid */
.categories-grid {
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    [dir="rtl"] .categories-grid {
        direction: rtl;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1536px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Enhanced Category Cards - Original Style */
.category-card, .card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.category-card:hover, .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Collapsible Container */
.category-items-container {
    transition: all 0.5s ease-in-out;
    overflow: hidden;
}

/* Item Cards */
.item-card {
    transition: all 0.3s ease;
}

.item-card:hover {
    background-color: #f9fafb;
}

/* Nutritional Tags - Original Style */
.nutrition-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
}

.nutrition-tag.allergen {
    background-color: #fee2e2;
    color: #dc2626;
}

.nutrition-tag.sugar {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.nutrition-tag.fat {
    background-color: #dbeafe;
    color: #2563eb;
}

.nutrition-tag.salt {
    background-color: #d1fae5;
    color: #059669;
}

/* Search Container */
.search-container {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.search-container input {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Statistics Cards */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(59, 130, 246, 0.3);
}

.stat-number {
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.empty-state-icon {
    margin: 0 auto 1rem;
    width: 3rem;
    height: 3rem;
    background-color: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Action Buttons */
.action-btn {
    transition: all 0.3s ease;
    border-radius: 6px;
}

.action-btn:hover {
    transform: translateY(-1px);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

/* Loading Overlay */
.loading-overlay {
    backdrop-filter: blur(4px);
    background: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 640px) {
    .stat-card {
        padding: 12px;
    }
    
    .search-container {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
}

/* Print Styles */
@media print {
    .category-card, .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .action-btn {
        display: none;
    }
    
    .category-items-container {
        max-height: none !important;
        opacity: 1 !important;
    }
}

/* Animation keyframes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 