/* === RunDone - نظام التصميم المتجاوب المتقدم === */

/* نظام Breakpoints متكامل */
:root {
    --breakpoint-xs: 375px;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;
}

/* شاشات XXL كبيرة جداً (1400px فما فوق) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
        margin: 0 auto;
    }
    
    .hero-content {
        max-width: 900px;
    }
    
    .hero h1 {
        font-size: clamp(4rem, 8vw, 6rem);
        line-height: 1.05;
    }
    
    .hero-subtitle {
        font-size: clamp(1.5rem, 2.5vw, 2rem);
        max-width: 700px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 3rem;
    }
    
    .technicians-grid {
        grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    }
    
    .dashboard-grid {
        grid-template-columns: 300px 1fr;
        gap: 2.5rem;
    }
}

/* شاشات XL كبيرة (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
    
    .hero h1 {
        font-size: clamp(3.5rem, 6vw, 4.5rem);
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

/* أجهزة اللاب توب (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .navbar {
        padding: 0 1.5rem;
    }
    
    .nav-links {
        gap: 1.75rem;
    }
    
    .hero h1 {
        font-size: clamp(3rem, 5vw, 4rem);
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .why-us-grid {
        gap: 3rem;
    }
    
    .image-placeholder {
        width: 400px;
        height: 400px;
    }
    
    /* لوحة التحكم */
    .admin-sidebar {
        width: 280px;
    }
    
    .admin-main {
        margin-right: 280px;
    }
}

/* أجهزة اللاب توب الصغيرة والأجهزة اللوحية الكبيرة (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    .navbar {
        padding: 1rem 1.5rem;
    }
    
    .nav-links {
        gap: 1.25rem;
    }
    
    .nav-links a {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .header-actions {
        gap: 0.75rem;
    }
    
    /* الهيرو سيكشن */
    .hero {
        min-height: 70vh;
        margin-top: var(--header-height);
    }
    
    .hero h1 {
        font-size: clamp(2.5rem, 4vw, 3.5rem);
        margin-bottom: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 2.5rem;
        line-height: 1.6;
    }
    
    .hero-actions {
        gap: 1rem;
    }
    
    /* الشبكات والتخطيطات */
    .why-us-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .why-us-content {
        padding-right: 0;
        text-align: center;
    }
    
    .features-list {
        max-width: 600px;
        margin: 2rem auto 0;
    }
    
    .image-placeholder {
        width: 350px;
        height: 350px;
        margin: 0 auto;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* الفوتر */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
    
    /* لوحة التحكم */
    .admin-sidebar {
        width: 80px;
    }
    
    .admin-main {
        margin-right: 80px;
    }
    
    .sidebar-header .logo span,
    .nav-link span,
    .badge {
        display: none;
    }
    
    .admin-sidebar:hover {
        width: 280px;
    }
    
    .admin-sidebar:hover .logo span,
    .admin-sidebar:hover .nav-link span,
    .admin-sidebar:hover .badge {
        display: inline;
    }
}

/* الأجهزة اللوحية (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 1.5rem;
    }
    
    /* نظام تنقل متقدم للجوال */
    .navbar {
        padding: 0.875rem 1.5rem;
        position: relative;
    }
    
    .nav-links {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-card);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 1.5rem;
        box-shadow: var(--shadow-2xl);
        border-top: 1px solid var(--border-color);
        z-index: 1000;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .nav-links.active {
        display: flex;
        transform: translateX(0);
    }
    
    .nav-links li {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .nav-links a {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 1.25rem 1.5rem;
        border-radius: var(--radius-xl);
        border: 1px solid var(--border-color);
        font-size: 1.1rem;
        font-weight: var(--font-semibold);
        transition: var(--transition-smooth);
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        background: var(--admin-gradient);
        color: white;
        transform: translateX(10px);
        border-color: transparent;
    }
    
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        padding: 0.75rem;
        cursor: pointer;
        z-index: 1001;
    }
    
    .mobile-menu-btn span {
        width: 24px;
        height: 2px;
        background: var(--text-primary);
        transition: var(--transition-smooth);
        transform-origin: center;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* هيرو سيكشن محسن */
    .hero {
        margin-top: 70px;
        min-height: 60vh;
        text-align: center;
    }
    
    .hero h1 {
        font-size: clamp(2.25rem, 5vw, 3rem);
        margin-bottom: 1.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
        line-height: 1.6;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    /* أقسام محسنة */
    .section {
        padding: 4rem 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    .section-title {
        font-size: clamp(2rem, 4vw, 2.5rem);
        margin-bottom: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    /* إحصائيات متجاوبة */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-card {
        padding: 2rem 1.5rem;
        text-align: center;
    }
    
    .stat-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* خدمات ومنتجات */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2.5rem 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* نظام الفنيين */
    .technicians-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .technician-card {
        padding: 2rem 1.5rem;
    }
    
    .technician-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .technician-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .technician-actions {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* نظام المهام */
    .task-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .task-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .task-meta {
        justify-content: center;
    }
    
    .task-actions {
        justify-content: center;
    }
    
    /* الفلترة */
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* الفوتر */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-links {
        justify-content: center;
    }
    
    .newsletter-form .form-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* الهواتف الكبيرة (480px - 575px) */
@media (min-width: 480px) and (max-width: 575px) {
    .container {
        padding: 0 1.25rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .technician-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* الهواتف المتوسطة (375px - 479px) */
@media (min-width: 375px) and (max-width: 479px) {
    .container {
        padding: 0 1rem;
    }
    
    .navbar {
        padding: 0.75rem 1rem;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .hero {
        min-height: 50vh;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .service-card,
    .product-card {
        padding: 2rem 1.5rem;
    }
    
    .technician-stats {
        grid-template-columns: 1fr;
    }
}

/* الهواتف الصغيرة (أقل من 375px) */
@media (max-width: 374px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .service-card,
    .product-card,
    .technician-card {
        padding: 1.5rem 1rem;
    }
}

/* تحسينات خاصة للوضع المظلم */
@media (max-width: 768px) {
    .dark-mode .nav-links {
        background: var(--bg-card);
        backdrop-filter: blur(30px);
    }
    
    .dark-mode .mobile-menu-btn span {
        background: var(--text-primary);
    }
    
    .dark-mode .nav-links a {
        border-color: var(--border-color);
    }
    
    .dark-mode .nav-links a:hover,
    .dark-mode .nav-links a.active {
        border-color: transparent;
    }
}

/* تحسينات للأجهزة التي تفضل الحركة المحدودة */
@media (prefers-reduced-motion: reduce) {
    @media (max-width: 768px) {
        .nav-links {
            transition: none;
        }
        
        .mobile-menu-btn span {
            transition: none;
        }
        
        .hero-actions .btn,
        .service-card,
        .product-card {
            transition: none;
        }
    }
}

/* تحسينات للشاشات العالية الدقة */
@media (min-resolution: 192dpi) and (max-width: 768px) {
    .hero {
        background-attachment: scroll;
    }
    
    .nav-links {
        backdrop-filter: blur(40px);
    }
}

/* تحسينات للطباعة */
@media print {
    @media (max-width: 768px) {
        .nav-links,
        .mobile-menu-btn,
        .hero-actions,
        .btn {
            display: none !important;
        }
        
        .hero {
            margin-top: 0;
            min-height: auto;
            background: white !important;
        }
        
        .section {
            padding: 1rem 0;
            break-inside: avoid;
        }
    }
}

/* تحسينات الوصول */
@media (prefers-contrast: high) {
    @media (max-width: 768px) {
        .nav-links a {
            border: 2px solid var(--text-primary);
        }
        
        .mobile-menu-btn span {
            background: var(--text-primary);
            height: 3px;
        }
    }
}

/* تحسينات للتوجيه الأفقي على الهواتف */
@media (max-height: 500px) and (max-width: 768px) {
    .hero {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .nav-links {
        padding: 1rem 1.5rem;
    }
    
    .nav-links a {
        padding: 1rem 1.25rem;
    }
}

/* تحسينات للشاشات القابلة للطي */
@media (max-width: 768px) and (max-aspect-ratio: 3/4) {
    .container {
        padding: 0 max(1rem, env(safe-area-inset-left));
    }
    
    .nav-links {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* تحسينات الأداء للجوال */
@media (max-width: 768px) {
    .will-change-mobile {
        will-change: transform, opacity;
    }
    
    /* تقليل تأثيرات الظل على الجوال للأداء */
    .service-card,
    .product-card,
    .technician-card {
        box-shadow: var(--shadow);
    }
    
    .service-card:hover,
    .product-card:hover,
    .technician-card:hover {
        box-shadow: var(--shadow-lg);
    }
}