/* ==========================================
   BOOFABI PARSEH - RESPONSIVE STYLESHEET
   Mobile-First Responsive Design
   Optimized by Professional Designer & Developer
   ========================================== */

/* ==========================================
   GLOBAL MOBILE FIXES (Applied First)
   ========================================== */
html {
    overflow-y: auto !important;
    overscroll-behavior-y: auto !important;
}

body {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    touch-action: manipulation;
}

/* Allow vertical scroll on globe canvas */
.globe-canvas {
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch !important;
}

/* ==========================================
   LARGE DESKTOP (1440px and up)
   ========================================== */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
        padding: 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .hero-buttons .btn {
        padding: 1rem 2.5rem;
        font-size: 1.125rem;
    }
}

/* ==========================================
   DESKTOP (1024px to 1439px)
   ========================================== */
@media (max-width: 1439px) {
    .container {
        max-width: 1200px;
        padding: 0 var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
}

/* ==========================================
   TABLET LANDSCAPE (768px to 1023px)
   ========================================== */
@media (max-width: 1023px) {
    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    /* Hero Section */
    .hero-section {
        min-height: 100vh;
        padding-top: 70px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .hero-buttons .btn {
        width: 100%;
        min-height: 48px; /* Touch-friendly */
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--spacing-lg);
    }
    
    /* Projects Grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-lg);
    }
}

/* ==========================================
   TABLET PORTRAIT (600px to 767px)
   ========================================== */
@media (max-width: 767px) {
    /* Navigation - Mobile Menu */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: var(--spacing-2xl);
        gap: var(--spacing-lg);
        box-shadow: var(--shadow-xl);
        transition: left var(--transition-base);
        z-index: 999;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    
    [dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    [dir="rtl"] .nav-menu.active {
        right: 0;
        left: auto;
    }
    
    .nav-menu a {
        font-size: 1.25rem;
        padding: var(--spacing-md) 0;
        min-height: 48px; /* Touch-friendly */
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .language-selector {
        order: -1;
    }
    
    /* Hero Section */
    .hero-section {
        min-height: 100dvh; /* Dynamic viewport height */
        padding-top: 70px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .hero-highlights {
        flex-direction: column;
        gap: var(--spacing-md);
        align-items: flex-start;
    }
    
    /* Section Spacing */
    .services-section,
    .projects-section,
    .about-section,
    .contact-section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-2xl);
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Service Cards */
    .service-card {
        padding: var(--spacing-xl);
    }
    
    .service-icon {
        font-size: 2.5rem;
    }
    
    .service-title {
        font-size: 1.5rem;
    }
    
    /* Project Results */
    .project-results {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .result-item {
        padding: var(--spacing-sm);
    }
    
    .result-number {
        font-size: 1.5rem;
    }
    
    /* Teams Grid */
    .teams-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Contact Form */
    .contact-form-wrapper {
        padding: var(--spacing-xl);
    }
    
    .contact-method {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .method-icon {
        font-size: 2.5rem;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-badges {
        flex-direction: column;
        align-items: center;
    }
}

/* ==========================================
   MOBILE (0px to 599px) - OPTIMIZED
   ========================================== */
@media (max-width: 599px) {
    /* Root Font Size - Minimum 16px for readability */
    :root {
        --font-size-base: 16px; /* Increased from 14px */
    }
    
    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Typography - Minimum sizes for mobile */
    h1 { font-size: 2rem; line-height: 1.2; }
    h2 { font-size: 1.75rem; line-height: 1.3; }
    h3 { font-size: 1.25rem; line-height: 1.4; }
    h4 { font-size: 1.125rem; line-height: 1.5; }
    p { font-size: 1rem; line-height: 1.6; }
    
    /* Navigation */
    .nav-container {
        padding: 0.75rem var(--spacing-md);
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .nav-menu {
        top: 60px;
        height: calc(100dvh - 60px); /* Dynamic height */
        padding: var(--spacing-xl);
    }
    
    /* Hero Section - Optimized for mobile */
    .hero-section {
        min-height: 100dvh !important; /* Dynamic viewport height */
        height: auto !important;
        padding-top: 60px;
    }
    
    .globe-canvas {
        height: 80dvh !important; /* Smaller canvas for scroll space */
        top: 10dvh !important;
    }
    
    .hero-content {
        padding: var(--spacing-xl) 0;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: var(--spacing-md);
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-tagline {
        font-size: 0.95rem;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-description {
        font-size: 1rem; /* Increased from 0.9rem */
        line-height: 1.7;
        margin-bottom: var(--spacing-xl);
    }
    
    .hero-buttons {
        gap: var(--spacing-md);
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        padding: 1rem 1.5rem; /* Larger touch target */
        font-size: 1rem;
        min-height: 48px; /* WCAG touch target standard */
        width: 100%;
    }
    
    .hero-highlights {
        gap: var(--spacing-md);
    }
    
    .highlight-item {
        font-size: 0.9rem;
    }
    
    .highlight-icon {
        font-size: 1rem;
    }
    
    /* Scroll Indicator */
    .scroll-indicator {
        bottom: 1.5rem;
    }
    
    .mouse {
        width: 28px;
        height: 45px;
    }
    
    /* Section Spacing */
    .services-section,
    .projects-section,
    .about-section,
    .contact-section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-2xl);
    }
    
    .section-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .section-subtitle {
        font-size: 1rem; /* Increased from 0.95rem */
        line-height: 1.6;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .service-card {
        padding: var(--spacing-xl);
    }
    
    .service-icon {
        font-size: 2rem;
        margin-bottom: var(--spacing-md);
    }
    
    .service-title {
        font-size: 1.25rem;
    }
    
    .service-subtitle {
        font-size: 1rem; /* Increased from 0.9rem */
    }
    
    .service-features li {
        font-size: 1rem;
        padding: 0.5rem 0;
    }
    
    .service-pricing {
        padding: var(--spacing-md);
    }
    
    .price {
        font-size: 1.75rem; /* Increased from 1.5rem */
    }
    
    .price-note {
        font-size: 0.875rem; /* Increased from 0.8rem */
    }
    
    .featured-badge {
        top: -10px;
        right: var(--spacing-md);
        padding: 0.5rem 1rem; /* Larger touch area */
        font-size: 0.875rem;
    }
    
    [dir="rtl"] .featured-badge {
        right: auto;
        left: var(--spacing-md);
    }
    
    /* Projects */
    .projects-grid {
        gap: var(--spacing-xl);
    }
    
    .project-card {
        padding: var(--spacing-xl);
    }
    
    .project-title {
        font-size: 1.5rem;
    }
    
    .project-category {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .project-description {
        font-size: 1rem; /* Increased from 0.9rem */
    }
    
    .project-tags {
        gap: 0.5rem;
    }
    
    .tag {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
        min-height: 32px;
    }
    
    /* About Section */
    .about-story h3 {
        font-size: 1.5rem;
    }
    
    .about-story p {
        font-size: 1rem;
    }
    
    .teams-grid {
        gap: var(--spacing-xl);
    }
    
    .team-card {
        padding: var(--spacing-xl);
    }
    
    .team-icon {
        font-size: 2.5rem;
    }
    
    .team-card h4 {
        font-size: 1.25rem;
    }
    
    .team-card blockquote {
        font-size: 1rem; /* Increased from 0.9rem */
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .stat-number {
        font-size: 2rem; /* Increased from 1.75rem */
    }
    
    .stat-label {
        font-size: 1rem; /* Increased from 0.875rem */
    }
    
    /* Contact Section */
    .contact-info h3 {
        font-size: 1.5rem;
    }
    
    .contact-methods {
        margin: var(--spacing-xl) 0;
    }
    
    .contact-method {
        margin-bottom: var(--spacing-lg);
    }
    
    .method-icon {
        font-size: 2rem;
    }
    
    .method-details h4 {
        font-size: 1.125rem;
    }
    
    .method-details a,
    .method-details p {
        font-size: 1rem; /* Increased from 0.9rem */
    }
    
    .payment-methods {
        padding: var(--spacing-md);
    }
    
    .payment-methods h4 {
        font-size: 1rem;
    }
    
    .payment-icons {
        font-size: 1.75rem; /* Increased from 1.5rem */
        gap: var(--spacing-md);
    }
    
    /* Contact Form */
    .contact-form-wrapper {
        padding: var(--spacing-xl);
    }
    
    .contact-form h3 {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-lg);
    }
    
    .form-group {
        margin-bottom: var(--spacing-lg);
    }
    
    .form-group label {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 1rem; /* Larger touch target */
        font-size: 1rem;
        min-height: 48px; /* WCAG standard */
    }
    
    .promo-banner {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
        text-align: center;
    }
    
    .promo-icon {
        font-size: 2rem;
    }
    
    .promo-content h4 {
        font-size: 1rem;
    }
    
    .promo-content p {
        font-size: 0.875rem;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-md);
    }
    
    .footer-grid {
        gap: var(--spacing-xl);
    }
    
    .footer-col h4 {
        font-size: 1.125rem;
        margin-bottom: var(--spacing-md);
    }
    
    .footer-col p {
        font-size: 1rem; /* Increased from 0.9rem */
    }
    
    .footer-links li {
        margin-bottom: 0.75rem;
    }
    
    .footer-links a {
        font-size: 1rem; /* Increased from 0.9rem */
        min-height: 44px; /* Touch-friendly */
        display: inline-block;
        line-height: 1.5;
    }
    
    .social-links {
        gap: var(--spacing-md);
        font-size: 1.5rem;
    }
    
    .crypto-accepted {
        font-size: 0.875rem; /* Increased from 0.8rem */
    }
    
    .footer-bottom {
        padding-top: var(--spacing-md);
        gap: var(--spacing-md);
    }
    
    .footer-bottom p {
        font-size: 0.875rem;
    }
    
    .footer-badges {
        gap: var(--spacing-md);
    }
    
    .footer-badges span {
        font-size: 0.875rem;
    }
    
    /* Back to Top Button */
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px; /* Larger touch target */
        height: 56px;
        font-size: 1.5rem;
    }
    
    [dir="rtl"] .back-to-top {
        right: auto;
        left: 1.5rem;
    }
    
    /* Language Selector */
    .lang-btn {
        min-height: 44px; /* Touch-friendly */
        padding: 0.75rem 1rem;
    }
    
    .lang-dropdown {
        min-width: 200px;
    }
    
    .lang-option {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        min-height: 44px; /* Touch-friendly */
    }
    
    /* Buttons - Touch-friendly sizes */
    .btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 48px; /* WCAG standard */
    }
}

/* ==========================================
   EXTRA SMALL MOBILE (0px to 374px)
   ========================================== */
@media (max-width: 374px) {
    :root {
        --font-size-base: 16px; /* Keep minimum 16px */
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .service-card,
    .project-card,
    .team-card,
    .contact-form-wrapper {
        padding: var(--spacing-md);
    }
    
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-buttons .btn {
        padding: 0.875rem 1.25rem;
    }
}

/* ==========================================
   LANDSCAPE ORIENTATION (Mobile)
   ========================================== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: var(--spacing-2xl) 0;
    }
    
    .globe-canvas {
        height: 60dvh !important;
        top: 5dvh !important;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .hero-content {
        padding: var(--spacing-lg) 0;
    }
    
    .nav-menu {
        height: auto;
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
    }
}

/* ==========================================
   PERFORMANCE OPTIMIZATIONS FOR MOBILE
   ========================================== */
@media (max-width: 767px) {
    /* Reduce animation complexity on mobile */
    * {
        transition-duration: 150ms !important;
    }
    
    /* Disable heavy animations on low-end devices */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation: none !important;
            transition: none !important;
        }
    }
    
    /* Optimize rendering */
    .hero-section,
    .globe-canvas,
    canvas {
        will-change: transform;
        backface-visibility: hidden;
    }
}

/* ==========================================
   ACCESSIBILITY ENHANCEMENTS
   ========================================== */
/* Minimum touch target size (WCAG 2.1 AA) */
@media (max-width: 767px) {
    a,
    button,
    .btn,
    input,
    select,
    textarea {
        min-height: 44px !important;
    }
    
    /* Increase tap target spacing */
    .nav-menu a,
    .footer-links a,
    .lang-option {
        padding: 0.75rem 0 !important;
    }
}

/* ==========================================
   SAFARI iOS SPECIFIC FIXES
   ========================================== */
@supports (-webkit-touch-callout: none) {
    .hero-section {
        min-height: -webkit-fill-available !important;
    }
    
    html {
        height: -webkit-fill-available !important;
    }
    
    body {
        height: -webkit-fill-available !important;
    }
}