/* Egyptian Schools Platform - Main Stylesheet */
/* المدارس المصرية */

:root {
    --primary: #003366;
    --primary-light: #004d99;
    --secondary: #005BAC;
    --accent: #F5A623;
    --bg: #F8FAFC;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #16A34A;
    --warning: #F59E0B;
    --danger: #DC2626;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,51,102,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --font-ar: 'Cairo', 'Tajawal', sans-serif;
    --font-en: 'Tajawal', 'Cairo', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 72px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-ar);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

[dir="ltr"] body { font-family: var(--font-en); }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--secondary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); }

.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { color: var(--primary); margin-bottom: 0.5rem; }
.section-title p { color: var(--text-muted); font-size: 1.1rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border-radius: var(--radius-sm); font-weight: 600;
    font-size: 0.95rem; border: 2px solid transparent; cursor: pointer;
    transition: all var(--transition); font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #004a8f; color: #fff; }
.btn-accent { background: var(--accent); color: var(--primary); }
.btn-accent:hover { background: #e09515; color: var(--primary); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 1.25rem; padding: 0.5rem; border-radius: 50%; transition: background var(--transition); }
.btn-icon:hover { background: var(--border); }

/* Header */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); height: var(--header-height);
    transition: all var(--transition);
}
[data-theme="dark"] .site-header { background: rgba(15,23,42,0.95); }
.site-header.scrolled { box-shadow: var(--shadow-lg); }

.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-height); }
.logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text); }
.logo-icon { font-size: 2rem; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-ar { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.logo-en { font-size: 0.7rem; color: var(--text-muted); }

.main-nav { display: flex; gap: 1.5rem; }
.nav-link { color: var(--text); font-weight: 500; position: relative; padding: 0.25rem 0; }
.nav-link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: var(--accent); transition: width var(--transition); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link:hover { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.btn-lang { padding: 0.4rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 600; font-size: 0.85rem; color: var(--text); }
.mobile-menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.mobile-menu-toggle span { display: block; width: 24px; height: 2px; background: var(--text); transition: var(--transition); }

/* Hero */
.hero {
    position: relative; min-height: 100vh; display: flex; align-items: center;
    padding-top: var(--header-height); overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #0077cc 100%);
}
.hero-canvas { position: absolute; inset: 0; z-index: 0; opacity: 0.3; }
.hero-content { position: relative; z-index: 1; color: #fff; max-width: 700px; }
.hero-badge {
    display: inline-block; background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
    padding: 0.5rem 1rem; border-radius: 50px; font-size: 0.85rem; margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}
.hero h1 { color: #fff; margin-bottom: 1.5rem; font-size: clamp(2rem, 5vw, 3.2rem); }
.hero p { font-size: 1.2rem; opacity: 0.9; margin-bottom: 2rem; line-height: 1.8; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-buttons .btn-primary { background: var(--accent); color: var(--primary); border-color: var(--accent); }
.hero-buttons .btn-outline { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero-buttons .btn-outline:hover { background: #fff; color: var(--primary); }
.hero-stats { display: flex; gap: 2rem; margin-top: 3rem; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat .number { font-size: 2rem; font-weight: 800; color: var(--accent); }
.hero-stat .label { font-size: 0.85rem; opacity: 0.8; }

/* Sections */
section { padding: 5rem 0; }
section:nth-child(even) { background: var(--bg-card); }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.feature-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 2rem;
    border: 1px solid var(--border); transition: all var(--transition); text-align: center;
}
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--secondary); }
.feature-icon { font-size: 3rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.75rem; color: var(--primary); }
.feature-card p { color: var(--text-muted); }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; counter-reset: step; }
.step-card { text-align: center; position: relative; padding: 2rem 1rem; }
.step-card::before {
    counter-increment: step; content: counter(step);
    display: flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 50%; background: var(--primary);
    color: #fff; font-weight: 800; font-size: 1.2rem; margin: 0 auto 1rem;
}
.step-card h3 { margin-bottom: 0.5rem; }
.step-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Stats */
.stats-section { background: var(--primary); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; text-align: center; }
.stat-item .number { font-size: 3rem; font-weight: 800; color: var(--accent); }
.stat-item .label { font-size: 1rem; opacity: 0.9; }

/* Benefits */
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.benefit-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 1.5rem;
    border-right: 4px solid var(--accent); border-left: none;
}
[dir="ltr"] .benefit-card { border-right: none; border-left: 4px solid var(--accent); }
.benefit-card h3 { color: var(--primary); margin-bottom: 0.5rem; font-size: 1.1rem; }

/* Testimonials */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.testimonial-card {
    background: var(--bg-card); border-radius: var(--radius); padding: 2rem;
    border: 1px solid var(--border); position: relative;
}
.testimonial-card::before { content: '"'; font-size: 4rem; color: var(--accent); opacity: 0.3; position: absolute; top: 0.5rem; right: 1.5rem; }
.testimonial-text { font-style: italic; margin-bottom: 1rem; color: var(--text-muted); }
.testimonial-author { font-weight: 700; color: var(--primary); }
.testimonial-role { font-size: 0.85rem; color: var(--text-muted); }

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.75rem; overflow: hidden; }
.faq-question {
    width: 100%; padding: 1.25rem 1.5rem; background: var(--bg-card); border: none;
    text-align: inherit; font-family: inherit; font-size: 1rem; font-weight: 600;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    color: var(--text); transition: background var(--transition);
}
.faq-question:hover { background: var(--bg); }
.faq-question .icon { transition: transform var(--transition); font-size: 1.2rem; }
.faq-item.active .faq-question .icon { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.faq-item.active .faq-answer { max-height: 500px; }
.faq-answer p { padding: 0 1.5rem 1.25rem; color: var(--text-muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-control {
    padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 1rem; background: var(--bg-card); color: var(--text);
    transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(0,91,172,0.15); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; }

/* Cards */
.card {
    background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border);
    overflow: hidden; transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-body { padding: 1.5rem; }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); font-weight: 700; }

/* Badges */
.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 50px;
    font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: #dcfce7; color: var(--success); }
.badge-warning { background: #fef3c7; color: var(--warning); }
.badge-danger { background: #fee2e2; color: var(--danger); }
.badge-info { background: #dbeafe; color: var(--secondary); }
.badge-urgent { background: var(--danger); color: #fff; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* Alerts */
.alert { padding: 1rem 1.5rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; }
.alert-success { background: #dcfce7; color: var(--success); border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: var(--danger); border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #dbeafe; color: var(--secondary); border: 1px solid #bfdbfe; }

/* Tables */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.75rem 1rem; text-align: inherit; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover { background: var(--bg); }

/* School Page */
.school-hero {
    position: relative; height: 300px; background: var(--primary);
    margin-top: var(--header-height);
}
.school-cover { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.school-hero-content {
    position: absolute; bottom: -60px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: flex-end; gap: 1.5rem; width: 100%; max-width: 1200px; padding: 0 1.5rem;
}
.school-logo {
    width: 120px; height: 120px; border-radius: var(--radius); border: 4px solid #fff;
    background: var(--bg-card); object-fit: cover; box-shadow: var(--shadow-lg); flex-shrink: 0;
}
.school-info-header { padding-bottom: 1rem; color: #fff; }
.school-info-header h1 { color: #fff; font-size: 1.8rem; }

.school-page { padding-top: 80px; }
.school-tabs { display: flex; gap: 0.5rem; border-bottom: 2px solid var(--border); margin-bottom: 2rem; overflow-x: auto; }
.school-tab {
    padding: 0.75rem 1.5rem; border: none; background: none; font-family: inherit;
    font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition);
}
.school-tab.active, .school-tab:hover { color: var(--primary); border-bottom-color: var(--accent); }

.content-filters { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; padding: 1rem; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.content-list { display: flex; flex-direction: column; gap: 1rem; }
.content-item {
    display: flex; gap: 1rem; padding: 1.25rem; background: var(--bg-card);
    border-radius: var(--radius-sm); border: 1px solid var(--border); transition: all var(--transition);
}
.content-item:hover { border-color: var(--secondary); box-shadow: var(--shadow); }
.content-item.urgent { border-right: 4px solid var(--danger); }
[dir="ltr"] .content-item.urgent { border-right: none; border-left: 4px solid var(--danger); }
.content-date { min-width: 60px; text-align: center; padding: 0.5rem; background: var(--bg); border-radius: var(--radius-sm); }
.content-date .day { font-size: 1.5rem; font-weight: 800; color: var(--primary); display: block; }
.content-date .month { font-size: 0.75rem; color: var(--text-muted); }

/* Search */
.search-hero { padding: calc(var(--header-height) + 3rem) 0 3rem; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; text-align: center; }
.search-hero h1 { color: #fff; margin-bottom: 1rem; }
.search-box { max-width: 600px; margin: 0 auto; display: flex; gap: 0.5rem; }
.search-box input { flex: 1; padding: 1rem 1.5rem; border: none; border-radius: var(--radius-sm); font-size: 1rem; font-family: inherit; }
.search-filters { display: flex; gap: 1rem; flex-wrap: wrap; margin: 2rem 0; }
.schools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.school-card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: all var(--transition); }
.school-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.school-card-body { padding: 1.5rem; }
.school-card h3 { color: var(--primary); margin-bottom: 0.5rem; }
.school-card .meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }

/* Auth */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: linear-gradient(135deg, var(--bg) 0%, #e8f0fe 100%); }
[data-theme="dark"] .auth-page { background: linear-gradient(135deg, var(--bg) 0%, #1a2744 100%); }
.auth-card { width: 100%; max-width: 480px; background: var(--bg-card); border-radius: var(--radius); padding: 2.5rem; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.auth-card h1 { text-align: center; margin-bottom: 0.5rem; color: var(--primary); }
.auth-card .subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2rem; }

/* Footer */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.85); padding: 4rem 0 0; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-brand h3 { color: #fff; margin-bottom: 0.75rem; }
.footer-credit { font-size: 0.85rem; opacity: 0.7; margin-top: 1rem; }
.footer-links h4, .footer-contact h4 { color: #fff; margin-bottom: 1rem; font-size: 1rem; }
.footer-links ul { list-style: none; }
.footer-links a { color: rgba(255,255,255,0.75); display: block; padding: 0.3rem 0; }
.footer-links a:hover { color: var(--accent); }
.social-links { display: flex; gap: 0.75rem; margin-top: 0.75rem; }
.social-links a { font-size: 1.5rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding: 1.5rem 0; text-align: center; font-size: 0.85rem; opacity: 0.7; }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; } .gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav { display: none; position: fixed; top: var(--header-height); left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 1.5rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); }
    .main-nav.open { display: flex; }
    .mobile-menu-toggle { display: flex; }
    .hero-buttons { flex-direction: column; }
    .contact-grid { grid-template-columns: 1fr; }
    .school-hero-content { flex-direction: column; align-items: center; text-align: center; bottom: -80px; }
    .school-hero { height: 250px; }
    .school-page { padding-top: 100px; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    section { padding: 3rem 0; }
}

/* Lazy loading */
img[loading="lazy"] { opacity: 0; transition: opacity 0.3s; }
img[loading="lazy"].loaded { opacity: 1; }

/* Print */
@media print {
    .site-header, .site-footer, .hero-buttons { display: none; }
    body { background: #fff; color: #000; }
}
