/* ===== RESPONSIVE DESIGN ===== */

/* Large devices (desktops, 1200px and up) */
@media (max-width: 1199.98px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .section-title {
        font-size: 2.2rem;
    }
}

/* Medium devices (tablets, 992px - 1199px) */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .section-padding {
        padding: 4rem 0;
    }

    .school-name {
        font-size: 1.2rem;
    }

    .navbar-nav .nav-link {
        margin: 0 0.5rem;
        font-size: 0.9rem;
    }
    
    /* تحسين الصور على الأجهزة اللوحية */
    .hero-bg, 
    .activity-gallery-item img,
    .news-image img {
        object-position: center center;
    }
    
    .director-image img {
        max-width: 280px !important;
        height: 320px !important;
    }
}

/* Small devices (landscape phones, 768px - 991px) */
@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-lg {
        width: 100%;
        max-width: 300px;
    }

    .school-name {
        font-size: 1.1rem;
    }

    .feature-item:hover {
        transform: translateX(-5px);
    }

    .activities-filter {
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 1rem;
        justify-content: flex-start;
    }

    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* تحسين الهيدر على الشاشات الصغيرة */
    .custom-navbar {
        padding: 0.5rem 0;
    }
    
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 10px;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
    }
    
    .language-switcher {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .pricing-card.featured {
        transform: none !important;
        margin: 1rem 0;
    }
}

/* Extra small devices (portrait phones, less than 768px) */
@media (max-width: 575.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .section-padding {
        padding: 3rem 0;
    }

    .academic-card {
        padding: 2rem 1rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .school-name {
        font-size: 1rem;
    }

    .navbar-nav .nav-link {
        font-size: 0.8rem;
        margin: 0 0.3rem;
        padding: 0.3rem 0.6rem !important;
    }

    .language-switcher .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    /* Hide some elements on mobile */
    .hero-buttons .btn {
        margin-bottom: 1rem;
    }

    /* Adjust grid systems */
    .col-md-6, .col-md-4, .col-md-3 {
        margin-bottom: 1.5rem;
    }

    /* Footer adjustments */
    .footer-brand {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .social-links {
        justify-content: center;
    }

    /* Forms adjustments */
    .form-control, .form-select {
        font-size: 0.9rem;
    }

    /* Timeline adjustments */
    .timeline-item {
        flex-direction: column;
        text-align: center;
    }

    .timeline-year {
        margin-bottom: 0.5rem;
    }
    
    /* تحسين الشعار على الموبايل */
    .logo-container {
        flex-direction: row !important;
        justify-content: center;
    }
    
    .school-logo {
        width: 45px !important;
        height: 45px !important;
    }
    
    .school-name {
        font-size: 0.9rem !important;
    }
}

/* Very small devices (phones, less than 400px) */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .btn-lg {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .activities-filter {
        flex-direction: column;
        align-items: center;
    }

    .filter-btn {
        width: 200px;
    }
}

/* ===== الأجهزة اللوحية - إعدادات خاصة ===== */

/* الأجهزة اللوحية - وضع أفقي */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .hero-section {
        height: 80vh !important;
    }
    
    .hero-title {
        font-size: 2.8rem !important;
    }
    
    .director-image img {
        max-width: 250px !important;
        height: 300px !important;
    }
}

/* الأجهزة اللوحية - وضع عمودي */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .hero-title {
        font-size: 3rem !important;
    }
    
    .hero-section {
        height: 70vh !important;
    }
}

/* ===== الشاشات الصغيرة جداً ===== */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.6rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.85rem !important;
    }
    
    .section-title {
        font-size: 1.4rem !important;
    }
    
    .btn {
        padding: 0.7rem 1.2rem !important;
        font-size: 0.9rem !important;
    }
    
    .school-logo {
        width: 40px !important;
        height: 40px !important;
    }
    
    .school-name {
        font-size: 0.8rem !important;
    }
}

/* ===== منع التكبير في حقول الإدخال على iOS ===== */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .custom-navbar,
    .hero-section,
    .custom-footer,
    .btn {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .container {
        width: 100% !important;
        max-width: none !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #2d3748;
        --dark-text: #e2e8f0;
        --accent-white: #1a202c;
    }

    body {
        background: #1a202c;
        color: #e2e8f0;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-orange: #ff0000;
        --secondary-blue: #0000ff;
    }

    .hero-title {
        -webkit-text-fill-color: initial;
        background: none;
        color: #000;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hero-bg {
        transition: none;
    }

    .activity-gallery-item,
    .news-card,
    .academic-card,
    .faculty-card {
        transition: none;
    }
}

/* ===== تحسينات إضافية للاستجابة ===== */

/* الشاشات الكبيرة جداً */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
}

/* الأجهزة ذات الارتفاع القليل */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        height: 100vh !important;
        min-height: 600px !important;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
        margin-bottom: 1.5rem !important;
    }
}

/* تحسينات للأجهزة التي تدعم اللمس */
@media (hover: none) and (pointer: coarse) {
    .feature-item:hover,
    .academic-card:hover,
    .news-card:hover,
    .faculty-card:hover {
        transform: none !important;
    }
    
    .activity-gallery-item:hover .gallery-overlay {
        transform: translateY(0);
    }
    
}
