* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    /* لون الشعار الأساسي - مطابق للكود الذي أرسلته */
    --brand-purple: #7f4199;
}

body {
    font-family: 'Tajawal', 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #2b2b2b;
    background: linear-gradient(135deg, #6f2dbd 0%, #9b4dca 60%, #c86bfa 100%);
    font-weight: 400;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Make media elements responsive by default */
img, video, canvas { max-width: 100%; height: auto; display: block; }
iframe { max-width: 100%; }

/* Offset anchors for fixed header so sections aren't hidden when scrolled to */
.section, .hero { scroll-margin-top: 74px; }

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
}

/* Hide mobile menu toggle on desktop */
.menu-toggle { display: none; }

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--brand-purple);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.logo::before { content: none; }
.logo-mark { height: 48px; width: auto; display: inline-block; object-fit: contain; border-radius: 14px; padding: 3px; background: rgba(255,255,255,0.9); box-shadow: 0 2px 10px rgba(0,0,0,0.12); filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12)); transition: transform 0.2s ease, filter 0.2s ease; }
.logo:hover .logo-mark { transform: scale(1.06); filter: drop-shadow(0 3px 10px rgba(0,0,0,0.18)); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

.nav-links a:hover {
    background: linear-gradient(45deg, var(--brand-purple), #9b4dca);
    color: white;
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    background-image: url('hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="20" cy="80" r="1.2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="30" r="0.8" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
    z-index: 0;
}

/* Dark overlay to ensure text readability over the image */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-weight: 500;
    line-height: 1.6;
}

.btn {
    display: inline-block;
    padding: 0.9rem 1.4rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    letter-spacing: 0.01em;
}

.btn:hover {
    background: white;
    color: var(--brand-purple);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 30px;
}

.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.whatsapp-btn { background: #25D366; border-color: rgba(255,255,255,0.0); }
.whatsapp-btn:hover { background: #1ebe57; color: #fff; }

/* Sections */
.section {
    padding: 5rem 0;
    background: white;
}

.section:nth-child(even) {
    background: #f8f9fa;
}

.section h2 {
    text-align: center;
    font-size: 2.3rem;
    font-weight: 700;
    margin-bottom: 2.2rem;
    color: #333;
    position: relative;
    letter-spacing: -0.01em;
}

.section h2::after {
    content: '';
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, var(--brand-purple), #9b4dca);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
    justify-content: center;
    gap: 1.2rem;
    margin-top: 2rem;
}

.about-card {
    background: white;
    padding: 1.6rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
}

.about-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.about-card .icon {
    font-size: 2.4rem;
    margin-bottom: 0.6rem;
}

.about-card h3 {
    color: var(--brand-purple);
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.about-card p {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
    font-weight: 400;
}

/* Programs */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}

.program-card {
    background: white;
    padding: 1.6rem;
    border-radius: 14px;
    border: 1px solid #eee;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.program-card .icon { font-size: 2rem; margin-bottom: 0.6rem; }

.program-card h3 {
    color: var(--brand-purple);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.program-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    font-weight: 400;
}

/* Gallery */
.gallery { background: #f8f9fa; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.6rem;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(45deg, var(--brand-purple), #9b4dca);
    background-size: cover;
    background-position: center;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.gallery-item::before {
    content: attr(data-title);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: white;
    padding: 1.4rem 1rem 0.9rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(155, 77, 202, 0.28);
    transition: all 0.3s ease;
}

.gallery-item:hover::after { background: rgba(155, 77, 202, 0.12); }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 1.6rem;
    border-radius: 15px;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.modal-content img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 10px;
    margin-bottom: 1rem;
    object-fit: cover;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
}

/* Contact */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 1.6rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 600; color: #333; }
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 10px rgba(102,126,234,0.2); }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 1.4rem;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.stat-number { font-size: 2rem; font-weight: 900; color: var(--brand-purple); }
.stat-label { color: #666; font-weight: 600; }

/* News */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.news-card { position: relative; background: #fff; border: 1px solid #eee; border-radius: 14px; padding: 1.8rem 1.2rem 1.2rem; }
.news-badge { position: absolute; top: 8px; inset-inline-start: 12px; background: var(--brand-purple); color: #fff; padding: 0.2rem 0.6rem; border-radius: 8px; font-size: 0.8rem; }

/* Announcements */
.announcements { background: #f8f9fa; padding-top: 2rem; padding-bottom: 2rem; }
.announcement-card { position: relative; background: #fff; border: 1px solid #eee; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.08); max-width: 600px; margin: 0 auto; }
.announcement-image { display: block; width: 100%; height: auto; }
.announcement-actions { display: flex; justify-content: center; padding: 0.8rem; }
.announcement-close { position: absolute; top: 8px; right: 12px; background: rgba(0,0,0,0.5); color: #fff; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; line-height: 32px; text-align: center; }
.announcement-close:hover { background: rgba(0,0,0,0.7); }

/* Staff */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.teacher-card { background: #fff; border: 1px solid #eee; border-radius: 14px; padding: 1rem; text-align: center; }
.teacher-card img { width: 100%; height: 220px; object-fit: cover; border-radius: 10px; margin-bottom: 0.6rem; }

/* Admissions */
.admissions-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.step { background: #fff; border: 1px solid #eee; border-radius: 14px; padding: 1rem; }
.step-number { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-purple); color: #fff; font-weight: 800; margin-bottom: 0.4rem; }
.cta-banner { background: linear-gradient(45deg, var(--brand-purple), #9b4dca); color: #fff; padding: 1.2rem; border-radius: 12px; text-align: center; }

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid #eee; }
.faq-question { width: 100%; text-align: right; background: none; border: none; padding: 1rem 0; font-size: 1.05rem; font-weight: 700; cursor: pointer; }
.faq-answer { display: none; padding: 0 0 1rem; color: #555; }
.faq-item.open .faq-answer { display: block; }

/* Footer */
.footer { background: #333; color: white; text-align: center; padding: 2rem 0; }
.social-buttons { display: flex; gap: 0.6rem; justify-content: center; margin-top: 0.8rem; flex-wrap: wrap; }
.social-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.1); display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: transform 0.2s ease, background 0.2s ease; }
.social-btn:hover { transform: translateY(-3px); }
.social-btn.facebook:hover { background: #1877F2; }
.social-btn.instagram:hover { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF, #515BD4); }
.social-btn.telegram:hover { background: #229ED9; }
.social-btn.tiktok:hover { background: #000; }
.social-btn.x:hover { background: #000; }
.social-btn.whatsapp:hover { background: #25D366; }
.social-btn.youtube:hover { background: #FF0000; }
.social-btn.maps:hover { background: #34A853; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: all 0.8s ease; }
.animate-on-scroll.animate { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle { display: inline-block; background: none; border: 2px solid #eee; padding: 0.3rem 0.6rem; border-radius: 8px; font-size: 1.1rem; cursor: pointer; }
    .nav-links { display: none; position: absolute; top: 56px; right: 20px; left: 20px; background: #fff; border-radius: 12px; padding: 0.8rem; box-shadow: 0 10px 30px rgba(0,0,0,0.12); flex-direction: column; gap: 0; }
    .nav-links a { display: block; padding: 0.8rem 0.6rem; border-radius: 8px; }
    .nav-links.show { display: flex; }
    .hero h1 { font-size: 2.2rem; }
    .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .logo-mark { height: 40px; border-radius: 12px; }
    .logo { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .section { padding: 3rem 0; }
    .btn { padding: 0.7rem 1rem; }
    .hero h1 { font-size: 1.9rem; }
    .announcement-card { max-width: 95%; }
    .nav-links { top: 52px; }
}

/* Contact section additions */
.contact-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 3rem; 
    margin-bottom: 2rem; 
    align-items: stretch;
}

.contact-info-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contact-info-section h3 {
    color: var(--brand-purple);
    font-size: 1.9rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.contact-info-section h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(45deg, var(--brand-purple), #9b4dca);
    border-radius: 2px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    justify-content: space-between;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    border-color: var(--brand-purple);
}

.contact-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-purple), #9b4dca);
    color: white;
    border-radius: 50%;
    flex-shrink: 0;
}

.contact-text h4 {
    color: var(--brand-purple);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.contact-text p {
    color: #555;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.contact-text a {
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-text a:hover {
    color: #9b4dca;
}

.wa-button {
    display: inline-flex;
    align-items: center;
    background: #25D366;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    white-space: nowrap;
    min-width: fit-content;
}

.wa-button:hover {
    background: #1ebe57;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.phone-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.phone-row a[href^="tel:"] {
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    font-size: 1.1rem;
    white-space: nowrap;
    min-width: fit-content;
}

.phone-row a[href^="tel:"]:hover {
    color: #9b4dca;
}

.map-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.map-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.map-container:hover .map-image {
    transform: scale(1.02);
}

.map-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem 1.5rem 1.5rem;
    color: white;
}

.map-info h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: white;
}

.coordinates {
    font-family: 'Courier New', monospace;
    background: rgba(255,255,255,0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.map-link {
    display: inline-flex;
    align-items: center;
    background: var(--brand-purple);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(127, 65, 153, 0.3);
}

.map-link:hover {
    background: #9b4dca;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(127, 65, 153, 0.4);
}

/* Responsive design for contact section */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        align-items: start;
    }
    
    .contact-info-section {
        height: auto;
    }
    
    .contact-details {
        justify-content: flex-start;
    }
    
    .map-section {
        height: auto;
    }
    
    .map-container {
        height: 300px;
    }
    
    .map-image {
        height: 300px;
    }
    
    .contact-item {
        padding: 1rem;
    }
    
    .contact-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .map-overlay {
        padding: 1.5rem 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
    
    .phone-row {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        text-align: center;
    }
    
    .phone-row a[href^="tel:"] {
        font-size: 1rem;
    }
    
    .wa-button {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .map-info h4 {
        font-size: 1.1rem;
    }
    
    .coordinates {
        font-size: 0.8rem;
    }
}

/* Footer grid */
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; align-items: center; }
.footer-links, .social-links { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.footer a { color: #fff; opacity: 0.9; text-decoration: none; }
.footer a:hover { text-decoration: underline; opacity: 1; }

/* Footer content */
.footer-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: start;
}

.footer-info h4 {
    color: var(--brand-purple);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.footer-info p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

.footer-social h4 {
    color: var(--brand-purple);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-social h4 {
        text-align: center;
    }
}

/* Inline WhatsApp link near phone numbers */
.wa-inline { 
    display: inline-block; 
    margin-inline-start: 8px; 
    padding: 0.2rem 0.5rem; 
    background: #25D366; 
    color: #fff; 
    border-radius: 6px; 
    font-weight: 700; 
    text-decoration: none; 
}
.wa-inline:hover { background: #1ebe57; }


