/* ========================================
   وجود لينك - WUJUD LINK
   ملف التصميم المتجاوب (Responsive)
   ======================================== */

/* ==================== TABLET LANDSCAPE (1024px) ==================== */
@media (max-width: 1024px) {
    .container {
        padding: 0 32px;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .section-title {
        font-size: 2.4rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

/* ==================== TABLET (768px) ==================== */
@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }
    
    /* Navigation - Fixed mobile menu issues */
    .nav-menu {
        position: fixed;
        top: 70px;
        right: 0;
        width: min(280px, 85vw);
        height: calc(100vh - 70px);
        flex-direction: column;
        background: rgba(26, 26, 26, 0.98);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        padding: 40px 24px;
        padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
        gap: 20px;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        border-left: 2px solid rgba(201, 249, 106, 0.2);
        z-index: 999;
        transform: translateX(110%);
        opacity: 0;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
        display: flex;
        overflow-y: auto;
        overflow-x: hidden;
        pointer-events: none;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 12px 0;
        border-bottom: 1px solid rgba(201, 249, 106, 0.1);
    }
    
    .mobile-menu-btn {
        display: flex;
        z-index: 1000;
        position: relative; /* Fixed: ensure proper layering */
    }
    
    /* Fixed: Improved hamburger animation */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
        background: var(--color-accent); /* Visual feedback */
    }
    
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px); /* Smooth disappear */
    }
    
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
        background: var(--color-accent); /* Visual feedback */
    }
    
    /* Fixed: Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }
    
    /* Hero */
    .hero {
        padding: 100px 24px 80px;
        min-height: initial;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .typing-container {
        font-size: 1.4rem;
        flex-direction: column;
        gap: 8px;
        min-height: 80px;
    }
    
    .typed-text {
        min-width: auto;
        text-align: center;
    }
    
    .hero-description {
        font-size: 1.05rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    
    .btn-primary {
        margin-left: 0;
        width: 100%;
        max-width: 300px;
    }
    
    .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
    
    /* Sections */
    .about-home,
    .services-home {
        padding: 80px 24px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .services-detail {
        padding: 80px 24px;
    }

    .services-detail-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .service-detail-card {
        padding: 40px 28px;
    }

    .story-grid {
        grid-template-columns: 1fr;
        gap: 36px;
        align-items: center;
    }

    .story-content {
        order: 1;
        text-align: right;
        padding-inline: 8px;
        max-width: 540px;
        margin-inline: auto;
    }

    .story-content .section-title {
        font-size: 2rem;
        margin-bottom: 16px;
    }

    .story-content .section-description {
        margin-bottom: 16px;
        font-size: 1rem;
        margin-right: 0;
        margin-left: 0;
    text-align: justify;
        line-height: 1.9;
    }

    .story-image {
        order: 2;
        display: flex;
        justify-content: center;
    }

    .image-placeholder-large {
        max-width: 260px;
        font-size: 5rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        padding: 60px 0;
    }

    .blog-image {
        height: 220px;
    }

    .blog-detail-media {
        margin-bottom: 24px;
    }

    .blog-detail {
        padding: 60px 24px 80px;
    }

    .blog-detail-content {
        padding: 32px;
    }

    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .related-post-thumb {
        width: 64px;
        height: 64px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .contact-form-wrapper {
        padding: 32px;
    }
    
    /* Footer */
    .footer {
        padding: 60px 24px 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    /* Floating shapes */
    .shape-1 {
        width: 200px;
        height: 200px;
    }
    
    .shape-2 {
        width: 150px;
        height: 150px;
    }
    
    .shape-3 {
        width: 180px;
        height: 180px;
    }
}

/* ==================== MOBILE (480px) ==================== */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    /* Header */
    .logo-text {
        font-size: 1.3rem;
    }
    
    .logo-subtitle {
        font-size: 0.6rem;
    }
    
    .nav-menu {
        width: 100%;
        right: 0;
    }
    
    /* Hero */
    .hero {
        padding: 80px 16px 60px;
    }
    
    .hero-title {
        font-size: 1.9rem;
        margin-bottom: 24px;
    }
    
    .typing-container {
        font-size: 1.1rem;
        min-height: 70px;
    }
    
    .hero-description {
        font-size: 0.95rem;
        margin-bottom: 32px;
    }
    
    /* Sections */
    .about-home,
    .services-home {
        padding: 60px 16px;
    }

    .services-detail {
        padding: 60px 16px;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .about-grid,
    .services-grid {
        gap: 20px;
    }

    .blog-detail {
        padding: 50px 16px 70px;
    }

    .blog-detail-content {
        padding: 28px;
    }

    .blog-image {
        height: 200px;
    }

    .related-post-thumb {
        width: 56px;
        height: 56px;
    }

    .related-posts-grid {
        gap: 16px;
    }

    .contact-form-wrapper {
        padding: 28px 20px;
    }

    .contact-info-card {
        padding: 24px;
    }
    
    .about-card,
    .service-card {
        padding: 32px 24px;
    }
    
    .card-icon,
    .service-icon {
        font-size: 2.8rem;
    }
    
    .card-title,
    .service-title {
        font-size: 1.3rem;
    }
    
    .card-text,
    .service-description {
        font-size: 0.9rem;
    }
    
    /* Buttons */
    .btn {
        padding: 12px 28px;
        font-size: 0.95rem;
    }
    
    /* Footer */
    .footer {
        padding: 40px 16px 16px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
    
    .social-icons {
        gap: 12px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Floating shapes */
    .shape-1 {
        width: 150px;
        height: 150px;
    }
    
    .shape-2 {
        width: 100px;
        height: 100px;
    }
    
    .shape-3 {
        width: 130px;
        height: 130px;
    }
}

/* ==================== SMALL MOBILE (360px) ==================== */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.6rem;
    }
    
    .typing-container {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

/* ==================== LANDSCAPE MODE ==================== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: unset;
        padding: 80px 40px 60px;
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 16px;
    }
    
    .typing-container {
        min-height: 50px;
        margin-bottom: 16px;
    }
    
    .hero-description {
        margin-bottom: 24px;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .header,
    .mobile-menu-btn,
    .hero-buttons,
    .footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section-title {
        color: black;
    }
}

/* ==================== ACCESSIBILITY ==================== */
@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 MODE ==================== */
@media (prefers-contrast: high) {
    .btn {
        border: 3px solid currentColor;
    }
    
    .service-card,
    .about-card {
        border-width: 3px;
    }
}
