/**
 * ملف الاستجابة للأجهزة المختلفة
 * Responsive Design Stylesheet
 * Dalil Alshamal Recruitment Website
 * Version: 2.0 - Professional Government Standards
 */

/* ========== نقاط التوقف (Breakpoints) ========== */
/*
    xs: 0-639px     (Mobile Portrait)
    sm: 640-767px   (Mobile Landscape)
    md: 768-1023px  (Tablet)
    lg: 1024-1279px (Desktop)
    xl: 1280px+     (Large Desktop)
*/

/* ========== تحسينات عامة للجوال (General Mobile Improvements) ========== */
@media (max-width: 767px) {
    /* تقليل حجم الخطوط */
    h1 {
        font-size: var(--font-size-3xl) !important;
    }
    
    h2 {
        font-size: var(--font-size-2xl) !important;
    }
    
    h3 {
        font-size: var(--font-size-xl) !important;
    }
    
    /* تقليل المسافات */
    .section {
        padding: var(--spacing-12) 0 !important;
    }
    
    .section-title h2 {
        font-size: var(--font-size-2xl) !important;
    }
    
    /* Hero Section */
    .hero-section {
        height: 350px !important;
    }
    
    .hero-content h1 {
        font-size: var(--font-size-2xl) !important;
    }
    
    .hero-content p {
        font-size: var(--font-size-base) !important;
    }
    
    .hero-buttons {
        flex-direction: column !important;
    }
    
    .hero-buttons .btn {
        width: 100% !important;
    }
    
    /* شاشة التحميل */
    .loading-logo {
        width: 90px !important;
        height: 90px !important;
    }
    
    .loading-text {
        font-size: var(--font-size-base) !important;
        padding: 0 var(--spacing-6) !important;
    }
    
    /* البطاقات */
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-4) !important;
    }
    
    .service-card {
        padding: var(--spacing-5) !important;
    }
    
    .service-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: var(--font-size-2xl) !important;
    }
    
    .professions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--spacing-3) !important;
    }
    
    .profession-card {
        padding: var(--spacing-4) !important;
    }
    
    .profession-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: var(--font-size-xl) !important;
    }
    
    .countries-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: var(--spacing-4) !important;
    }
    
    .country-circle {
        width: 70px !important;
        height: 70px !important;
        font-size: var(--font-size-lg) !important;
    }
    
    .contact-info-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-4) !important;
    }
    
    .contact-info-card {
        padding: var(--spacing-5) !important;
    }
    
    .contact-info-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: var(--font-size-xl) !important;
    }
}

/* ========== شاشات كبيرة جداً (Extra Large Screens) ========== */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* ========== شاشات كبيرة (Large Screens - Desktop) ========== */
@media (min-width: 1024px) and (max-width: 1279px) {
    .container {
        max-width: 1024px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
}

/* ========== شاشات متوسطة (Medium Screens - Tablet) ========== */
@media (max-width: 1023px) {
    /* Typography */
    :root {
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.5rem;
    }
    
    /* Container */
    .container {
        max-width: 100%;
        padding-left: var(--spacing-6);
        padding-right: var(--spacing-6);
    }
    
    /* Header */
    .logo img {
        width: 50px;
        height: 50px;
    }
    
    .logo-title {
        font-size: var(--font-size-lg);
    }
    
    .logo-subtitle {
        font-size: var(--font-size-xs);
    }
    
    /* Hero Section */
    .hero-section {
        height: 400px;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-description {
        font-size: var(--font-size-base);
    }
    
    /* Sections */
    .section {
        padding: var(--spacing-16) 0;
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    /* Grid */
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Cards */
    .service-card {
        padding: var(--spacing-6);
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: var(--font-size-3xl);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Fixed Buttons */
    .fixed-buttons {
        bottom: var(--spacing-4);
        right: var(--spacing-4);
    }
    
    .fixed-btn {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-xl);
    }
}

/* ========== شاشات صغيرة (Small Screens - Mobile Landscape) ========== */
@media (max-width: 767px) {
    /* Typography */
    :root {
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --font-size-xl: 1.125rem;
    }
    
    /* Container */
    .container {
        padding-left: var(--spacing-4);
        padding-right: var(--spacing-4);
    }
    
    /* News Ticker */
    .news-ticker-title {
        font-size: var(--font-size-xs);
        padding: var(--spacing-1) var(--spacing-3);
    }
    
    /* Mini Header */
    .mini-header-container {
        flex-direction: column;
        gap: var(--spacing-2);
    }
    
    .mini-header-right,
    .mini-header-left {
        width: 100%;
        justify-content: center;
    }
    
    /* Main Header */
    .main-header .container {
        padding-top: var(--spacing-3);
        padding-bottom: var(--spacing-3);
    }
    
    .logo img {
        width: 45px;
        height: 45px;
    }
    
    .logo-title {
        font-size: var(--font-size-base);
    }
    
    .logo-subtitle {
        font-size: 0.7rem;
    }
    
    .hamburger-btn {
        width: 36px;
        height: 36px;
    }
    
    .hamburger-btn span {
        width: 20px;
        height: 2px;
    }
    
    /* Side Menu */
    .side-menu {
        width: 280px;
    }
    
    .side-menu-header {
        padding: var(--spacing-4);
    }
    
    .side-menu-title {
        font-size: var(--font-size-lg);
    }
    
    .side-menu-nav a {
        padding: var(--spacing-3);
        font-size: var(--font-size-sm);
    }
    
    /* Hero Section */
    .hero-section {
        height: 350px;
    }
    
    .hero-content {
        padding: var(--spacing-6);
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-4);
    }
    
    .hero-description {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-6);
    }
    
    /* Sections */
    .section {
        padding: var(--spacing-12) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-8);
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .section-title::after {
        width: 60px;
        height: 3px;
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Grid */
    .grid {
        gap: var(--spacing-4);
    }
    
    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: repeat(1, 1fr);
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-3) var(--spacing-5);
        font-size: var(--font-size-sm);
    }
    
    .btn-lg {
        padding: var(--spacing-3) var(--spacing-6);
        font-size: var(--font-size-base);
    }
    
    /* Cards */
    .card {
        border-radius: var(--border-radius-lg);
    }
    
    .card-header,
    .card-body,
    .card-footer {
        padding: var(--spacing-4);
    }
    
    .service-card {
        padding: var(--spacing-5);
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-4);
    }
    
    .service-title {
        font-size: var(--font-size-lg);
    }
    
    .service-description {
        font-size: var(--font-size-sm);
    }
    
    .profession-card {
        padding: var(--spacing-4);
    }
    
    .profession-icon {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-2xl);
    }
    
    .profession-name {
        font-size: var(--font-size-base);
    }
    
    .country-card {
        width: 100px;
        height: 100px;
    }
    
    .country-flag {
        font-size: var(--font-size-3xl);
    }
    
    .country-name {
        font-size: var(--font-size-xs);
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        border-radius: var(--border-radius-xl);
    }
    
    .modal-header {
        padding: var(--spacing-4);
        border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
    }
    
    .modal-title {
        font-size: var(--font-size-xl);
    }
    
    .modal-body {
        padding: var(--spacing-4);
    }
    
    /* Forms */
    .form-group {
        margin-bottom: var(--spacing-4);
    }
    
    .form-control {
        padding: var(--spacing-2) var(--spacing-3);
        font-size: var(--font-size-sm);
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-12) 0 var(--spacing-6);
    }
    
    .footer-content {
        grid-template-columns: repeat(1, 1fr);
        gap: var(--spacing-6);
    }
    
    .footer-section h3 {
        font-size: var(--font-size-lg);
    }
    
    /* Fixed Buttons */
    .fixed-buttons {
        bottom: var(--spacing-3);
        right: var(--spacing-3);
        gap: var(--spacing-2);
    }
    
    .fixed-btn {
        width: 48px;
        height: 48px;
        font-size: var(--font-size-lg);
    }
}

/* ========== شاشات صغيرة جداً (Extra Small Screens - Mobile Portrait) ========== */
@media (max-width: 479px) {
    /* Typography */
    :root {
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
        --font-size-3xl: 1.375rem;
        --font-size-2xl: 1.125rem;
        --font-size-xl: 1rem;
    }
    
    /* Container */
    .container {
        padding-left: var(--spacing-3);
        padding-right: var(--spacing-3);
    }
    
    /* Loading Screen */
    .loading-logo {
        width: 100px;
        height: 100px;
    }
    
    .loading-text {
        font-size: var(--font-size-xl);
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    
    /* News Ticker */
    .news-ticker {
        padding: var(--spacing-2) 0;
    }
    
    .news-ticker-container {
        gap: var(--spacing-2);
    }
    
    /* Header */
    .logo img {
        width: 40px;
        height: 40px;
    }
    
    .logo-title {
        font-size: var(--font-size-sm);
    }
    
    .logo-subtitle {
        font-size: 0.65rem;
    }
    
    .hamburger-btn {
        width: 32px;
        height: 32px;
    }
    
    /* Side Menu */
    .side-menu {
        width: 260px;
    }
    
    /* Hero Section */
    .hero-section {
        height: 300px;
    }
    
    .hero-content {
        padding: var(--spacing-4);
    }
    
    .hero-title {
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-3);
    }
    
    .hero-description {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-4);
    }
    
    /* Sections */
    .section {
        padding: var(--spacing-10) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-6);
    }
    
    .section-title {
        font-size: var(--font-size-xl);
    }
    
    .section-title::after {
        width: 50px;
        height: 2px;
        bottom: -8px;
    }
    
    .section-subtitle {
        font-size: var(--font-size-sm);
    }
    
    /* Grid */
    .grid {
        gap: var(--spacing-3);
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-2) var(--spacing-4);
        font-size: var(--font-size-sm);
    }
    
    .btn-lg {
        padding: var(--spacing-3) var(--spacing-5);
        font-size: var(--font-size-base);
    }
    
    /* Cards */
    .service-card {
        padding: var(--spacing-4);
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-3);
    }
    
    .service-title {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-2);
    }
    
    .service-description {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-4);
    }
    
    .profession-card {
        padding: var(--spacing-3);
    }
    
    .profession-icon {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-2);
    }
    
    .profession-name {
        font-size: var(--font-size-sm);
    }
    
    .country-card {
        width: 90px;
        height: 90px;
    }
    
    .country-flag {
        font-size: var(--font-size-2xl);
    }
    
    .country-name {
        font-size: 0.7rem;
    }
    
    /* Modal */
    .modal-header {
        padding: var(--spacing-3);
    }
    
    .modal-title {
        font-size: var(--font-size-lg);
    }
    
    .modal-close {
        width: 32px;
        height: 32px;
        font-size: var(--font-size-lg);
    }
    
    .modal-body {
        padding: var(--spacing-3);
    }
    
    /* Forms */
    .form-group {
        margin-bottom: var(--spacing-3);
    }
    
    .form-label {
        font-size: var(--font-size-xs);
    }
    
    .form-control {
        padding: var(--spacing-2);
        font-size: var(--font-size-sm);
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-10) 0 var(--spacing-4);
    }
    
    .footer-content {
        gap: var(--spacing-4);
    }
    
    .footer-section h3 {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-3);
    }
    
    .footer-section p,
    .footer-section a {
        font-size: var(--font-size-sm);
    }
    
    .social-links {
        gap: var(--spacing-3);
    }
    
    .social-link {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
    }
    
    /* Fixed Buttons */
    .fixed-buttons {
        bottom: var(--spacing-2);
        right: var(--spacing-2);
    }
    
    .fixed-btn {
        width: 44px;
        height: 44px;
        font-size: var(--font-size-base);
    }
}

/* ========== الوضع الأفقي للجوال (Mobile Landscape) ========== */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-section {
        height: 280px;
    }
    
    .hero-title {
        font-size: var(--font-size-xl);
    }
    
    .hero-description {
        font-size: var(--font-size-sm);
    }
    
    .section {
        padding: var(--spacing-8) 0;
    }
}

/* ========== شاشات اللمس (Touch Devices) ========== */
@media (hover: none) and (pointer: coarse) {
    /* زيادة حجم الأزرار للمس */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .hamburger-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .user-icon-btn,
    .lang-switcher {
        min-height: 44px;
    }
    
    /* إزالة تأثيرات الـ hover */
    .card:hover,
    .service-card:hover,
    .profession-card:hover,
    .country-card:hover {
        transform: none;
    }
    
    /* تفعيل التأثيرات عند اللمس */
    .card:active,
    .service-card:active,
    .profession-card:active,
    .country-card:active {
        transform: scale(0.98);
    }
}

/* ========== الطباعة (Print) ========== */
@media print {
    /* إخفاء العناصر غير الضرورية */
    .news-ticker,
    .mini-header,
    .hamburger-btn,
    .side-menu,
    .fixed-buttons,
    .modal,
    .no-print {
        display: none !important;
    }
    
    /* تحسين الطباعة */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .section {
        padding: 20px 0;
        page-break-inside: avoid;
    }
    
    .card,
    .service-card,
    .profession-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    a {
        text-decoration: underline;
        color: #000;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }
}

/* ========== الوضع الداكن (Dark Mode) - اختياري ========== */
@media (prefers-color-scheme: dark) {
    /* يمكن إضافة دعم الوضع الداكن لاحقاً */
    /* body {
        background-color: #1a1a1a;
        color: #f0f0f0;
    } */
}

/* ========== تقليل الحركة (Reduced Motion) ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== تباين عالي (High Contrast) ========== */
@media (prefers-contrast: high) {
    :root {
        --border-width-thin: 2px;
        --border-width-medium: 3px;
    }
    
    .btn,
    .card,
    .form-control {
        border-width: var(--border-width-medium);
    }
    
    a {
        text-decoration: underline;
    }
}

/* ========== شاشات صغيرة للغاية (Very Small Screens) ========== */
@media (max-width: 360px) {
    :root {
        --font-size-base: 0.9375rem; /* 15px */
    }
    
    .container {
        padding-left: var(--spacing-2);
        padding-right: var(--spacing-2);
    }
    
    .logo-text {
        display: none;
    }
    
    .side-menu {
        width: 240px;
    }
    
    .hero-section {
        height: 250px;
    }
    
    .section {
        padding: var(--spacing-8) 0;
    }
    
    .grid {
        gap: var(--spacing-2);
    }
}

/* ========== iPad و Tablets محددة ========== */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 768px;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== iPad Pro و Tablets كبيرة ========== */
@media (min-width: 1024px) and (max-width: 1366px) {
    .container {
        max-width: 1024px;
    }
}

/* ========== شاشات عريضة جداً (Ultra Wide) ========== */
@media (min-width: 1920px) {
    .container {
        max-width: 1440px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
}