/* DzExams - Arabic Educational Platform Styles */
/* Tailwind-like utility classes with RTL support */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

/* SVG sizing fix - prevent huge icons */
svg {
    max-width: 100%;
    max-height: 100%;
    display: inline-block;
    vertical-align: middle;
}

/* Force reasonable default size for SVGs without explicit dimensions */
svg:not([width]):not([height]) {
    width: 1em;
    height: 1em;
}

/* Ensure container-constrained SVGs behave */
svg[class*="w-"], svg[class*="h-"] {
    max-width: none;
    max-height: none;
}

:root {
    --primary: #059669;
    --primary-light: #ecfdf5;
    --primary-dark: #047857;
    --secondary: #2563eb;
    --accent: #9333ea;
    --warning: #f59e0b;
    --danger: #e11d48;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.04);
    --shadow: 0 1px 3px 0 rgba(0,0,0,0.08), 0 1px 2px 0 rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: 'Tajawal', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.max-w-7xl { max-width: 80rem; }
.max-w-3xl { max-width: 48rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }

/* Grid */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Flex */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

/* Text */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-8xl { font-size: 6rem; }
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Colors */
.text-white { color: #ffffff; }
.text-gray-50 { color: #f9fafb; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-emerald-50 { color: #ecfdf5; }
.text-emerald-100 { color: #d1fae5; }
.text-emerald-400 { color: #34d399; }
.text-emerald-500 { color: #10b981; }
.text-emerald-600 { color: #059669; }
.text-emerald-700 { color: #047857; }
.text-emerald-900 { color: #064e3b; }
.text-blue-50 { color: #eff6ff; }
.text-blue-100 { color: #dbeafe; }
.text-blue-600 { color: #2563eb; }
.text-blue-700 { color: #1d4ed8; }
.text-blue-900 { color: #1e3a8a; }
.text-purple-50 { color: #faf5ff; }
.text-purple-100 { color: #f3e8ff; }
.text-purple-600 { color: #9333ea; }
.text-purple-700 { color: #7e22ce; }
.text-purple-900 { color: #581c87; }
.text-rose-50 { color: #fff1f2; }
.text-rose-100 { color: #ffe4e6; }
.text-rose-600 { color: #e11d48; }
.text-rose-700 { color: #be123c; }
.text-rose-800 { color: #9f1239; }
.text-rose-900 { color: #881337; }
.text-amber-50 { color: #fffbeb; }
.text-amber-100 { color: #fef3c7; }
.text-amber-500 { color: #f59e0b; }
.text-amber-600 { color: #d97706; }
.text-amber-700 { color: #b45309; }
.text-amber-900 { color: #78350f; }
.text-orange-50 { color: #fff7ed; }
.text-orange-100 { color: #ffedd5; }
.text-orange-500 { color: #f97316; }
.text-orange-600 { color: #ea580c; }
.text-orange-700 { color: #c2410c; }
.text-orange-900 { color: #7c2d12; }
.text-teal-50 { color: #f0fdfa; }
.text-teal-100 { color: #ccfbf1; }
.text-teal-600 { color: #0d9488; }
.text-teal-700 { color: #0f766e; }
.text-teal-900 { color: #134e4a; }
.text-cyan-50 { color: #ecfeff; }
.text-cyan-100 { color: #cffafe; }
.text-cyan-700 { color: #0e7490; }
.text-pink-50 { color: #fdf2f8; }
.text-pink-100 { color: #fce7f3; }
.text-pink-700 { color: #be185d; }
.text-slate-50 { color: #f8fafc; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-900 { color: #0f172a; }
.text-red-600 { color: #dc2626; }

/* Backgrounds */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-900 { background-color: #111827; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-emerald-100 { background-color: #d1fae5; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-emerald-700 { background-color: #047857; }
.bg-emerald-900 { background-color: #064e3b; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-purple-100 { background-color: #f3e8ff; }
.bg-purple-600 { background-color: #9333ea; }
.bg-purple-700 { background-color: #7e22ce; }
.bg-rose-50 { background-color: #fff1f2; }
.bg-rose-100 { background-color: #ffe4e6; }
.bg-rose-600 { background-color: #e11d48; }
.bg-rose-700 { background-color: #be123c; }
.bg-amber-50 { background-color: #fffbeb; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-orange-50 { background-color: #fff7ed; }
.bg-orange-100 { background-color: #ffedd5; }
.bg-orange-500 { background-color: #f97316; }
.bg-orange-600 { background-color: #ea580c; }
.bg-teal-50 { background-color: #f0fdfa; }
.bg-teal-600 { background-color: #0d9488; }
.bg-teal-700 { background-color: #0f766e; }
.bg-pink-50 { background-color: #fdf2f8; }
.bg-pink-100 { background-color: #fce7f3; }
.bg-cyan-50 { background-color: #ecfeff; }
.bg-cyan-100 { background-color: #cffafe; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-700 { background-color: #334155; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-indigo-50 { background-color: #eef2ff; }
.bg-indigo-100 { background-color: #e0e7ff; }
.bg-violet-50 { background-color: #f5f3ff; }
.bg-violet-100 { background-color: #ede9fe; }
.bg-fuchsia-50 { background-color: #fdf4ff; }
.bg-fuchsia-100 { background-color: #fae8ff; }
.bg-stone-100 { background-color: #f5f5f4; }

/* Rounded */
.rounded-lg { border-radius: var(--radius-sm); }
.rounded-xl { border-radius: var(--radius); }
.rounded-2xl { border-radius: var(--radius-lg); }
.rounded-3xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }

/* Borders */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-gray-50 { border-color: #f9fafb; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-800 { border-color: #1f2937; }
.border-emerald-100 { border-color: #d1fae5; }
.border-emerald-200 { border-color: #a7f3d0; }
.border-emerald-300 { border-color: #6ee7b7; }
.border-blue-100 { border-color: #dbeafe; }
.border-purple-100 { border-color: #f3e8ff; }
.border-purple-200 { border-color: #e9d5ff; }
.border-purple-300 { border-color: #d8b4fe; }
.border-rose-100 { border-color: #ffe4e6; }
.border-amber-100 { border-color: #fef3c7; }
.border-orange-100 { border-color: #ffedd5; }
.border-teal-100 { border-color: #ccfbf1; }
.border-slate-100 { border-color: #f1f5f9; }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Sticky */
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }

/* Transitions */
.transition { transition-property: color, background-color, border-color, box-shadow, transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Hover states */
a:hover { text-decoration: none; }
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-emerald-50:hover { background-color: #ecfdf5; }
.hover\:bg-emerald-700:hover { background-color: #047857; }
.hover\:bg-emerald-800:hover { background-color: #065f46; }
.hover\:bg-blue-700:hover { background-color: #1d4ed8; }
.hover\:bg-rose-700:hover { background-color: #be123c; }
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:bg-teal-700:hover { background-color: #0f766e; }
.hover\:bg-orange-700:hover { background-color: #c2410c; }
.hover\:bg-amber-700:hover { background-color: #b45309; }
.hover\:text-emerald-400:hover { color: #34d399; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-blue-700:hover { color: #1d4ed8; }
.hover\:text-blue-800:hover { color: #1e40af; }
.hover\:text-emerald-700:hover { color: #047857; }
.hover\:text-emerald-800:hover { color: #065f46; }
.hover\:text-purple-700:hover { color: #7e22ce; }
.hover\:text-slate-900:hover { color: #0f172a; }
.hover\:opacity-80:hover { opacity: 0.8; }
.hover\:opacity-90:hover { opacity: 0.9; }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.hover\:border-emerald-200:hover { border-color: #a7f3d0; }
.hover\:border-emerald-300:hover { border-color: #6ee7b7; }
.hover\:border-purple-200:hover { border-color: #e9d5ff; }
.hover\:border-purple-300:hover { border-color: #d8b4fe; }

/* Focus */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5); }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Display */
.block { display: block; }
.hidden { display: none; }
.inline-block { display: inline-block; }
.w-1 { width: 0.25rem; }
.w-1\.5 { width: 0.375rem; }
.w-2 { width: 0.5rem; }
.w-3 { width: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-20 { width: 5rem; }
.w-56 { width: 14rem; }
.w-full { width: 100%; }
.h-1 { height: 0.25rem; }
.h-1\.5 { height: 0.375rem; }
.h-2 { height: 0.5rem; }
.h-3 { height: 0.75rem; }
.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-20 { height: 5rem; }
.min-h-screen { min-height: 100vh; }

/* Max width */
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-md { max-width: 28rem; }

/* Margins */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-auto { margin-top: auto; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mr-6 { margin-right: 1.5rem; }
.ml-6 { margin-left: 1.5rem; }
.mx-6 { margin-left: 1.5rem; margin-right: 1.5rem; }

/* Group hover for dropdowns */
.group:hover .group-hover\:block { display: block; }

/* Relative/Absolute */
.relative { position: relative; }
.absolute { position: absolute; }
.top-full { top: 100%; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Responsive - Small screens */
@media (max-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:flex { display: flex; }
    .sm\:hidden { display: none; }
}

/* Responsive - Medium screens */
@media (min-width: 768px) {
    .md\:block { display: block; }
    .md\:hidden { display: none; }
    .md\:flex { display: flex; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:col-span-1 { grid-column: span 1 / span 1; }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
    .md\:text-3xl { font-size: 1.875rem; }
    .md\:text-5xl { font-size: 3rem; }
    .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
    .md\:px-4 { padding-left: 1rem; padding-right: 1rem; }
}

/* Responsive - Large screens */
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
}

/* Print styles */
@media print {
    header, footer, nav { display: none !important; }
    main { margin: 0; padding: 0; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Custom scrollbar */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* DzExams Components */
.hero-gradient { background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%); }
.hero-pattern { position: relative; overflow: hidden; }
.hero-pattern::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none;
}
.level-card { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid var(--border); }
.level-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.subject-card { transition: all 0.2s ease; }
.subject-card:hover { background: var(--bg-white); box-shadow: var(--shadow-md); border-color: var(--primary); }
.nav-dropdown {
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}
.group:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.search-input {
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 9999px;
    padding: 10px 16px 10px 40px;
    font-size: 14px;
    width: 100%;
    transition: all 0.2s;
    font-family: inherit;
}
.search-input:focus { outline: none; background: white; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
.btn-hero {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px; border-radius: 9999px;
    font-size: 15px; font-weight: 700; text-decoration: none;
    transition: all 0.2s;
    cursor: pointer; border: none; font-family: inherit;
}
.btn-hero-primary { background: white; color: var(--primary-dark); }
.btn-hero-primary:hover { background: #f9fafb; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-hero-secondary { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); backdrop-filter: blur(8px); }
.btn-hero-secondary:hover { background: rgba(255,255,255,0.25); }
.stats-number { font-size: 2.25rem; font-weight: 800; line-height: 1; }
.section-title { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 0.5rem; }
.section-subtitle { color: var(--text-muted); font-size: 1rem; }
.resource-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #f3f4f6; transition: background 0.15s; }
.resource-row:last-child { border-bottom: none; }
.resource-row:hover { background: #fafafa; }
.footer-link { color: #9ca3af; text-decoration: none; transition: color 0.2s; }
.footer-link:hover { color: white; }
@media (max-width: 768px) {
    .stats-number { font-size: 1.5rem; }
    .section-title { font-size: 1.4rem; }
}
