/* Reset and Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Cross-browser button reset */
button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Cross-browser link reset */
a {
    color: inherit;
    text-decoration: none;
}

/* Ensure consistent rendering */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    /* Colors - Dark Theme (Default) */
    --primary-color: #00A3FF;
    --primary-dark: #0080cc;
    --secondary-color: #ff6b35;
    --accent-color: #7c3aed;
    --bg-primary: #0D1117;
    --bg-secondary: #1C2128;
    --bg-tertiary: #161B22;
    --text-primary: #ffffff;
    --text-secondary: #b8c5d6;
    --text-muted: #8892b0;
    --border-color: rgba(0, 212, 255, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --font-arabic: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --container-max-width: 1200px;
    --section-padding: 80px 0;
    --grid-gap: 2rem;
    
    /* Animations */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Light Theme */
[data-theme="light"],
.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(0, 163, 255, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
}

/* Light theme specific adjustments */
[data-theme="light"] .navbar,
.theme-light .navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom: 1px solid rgba(0, 163, 255, 0.3) !important;
}

[data-theme="light"] .navbar.scrolled,
.theme-light .navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 20px rgba(0, 163, 255, 0.1) !important;
}

[data-theme="light"] .hero-description,
.theme-light .hero-description {
    color: #475569 !important;
}

[data-theme="light"] .grid-pattern,
.theme-light .grid-pattern {
    background-image: 
        linear-gradient(rgba(0, 163, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 163, 255, 0.08) 1px, transparent 1px) !important;
}

[data-theme="light"] .gradient-overlay,
.theme-light .gradient-overlay {
    background: radial-gradient(ellipse at center, transparent 0%, #ffffff 70%) !important;
}

/* Light theme sections */
[data-theme="light"] .about,
.theme-light .about {
    background: #f8fafc !important;
}

[data-theme="light"] .services,
.theme-light .services {
    background: #ffffff !important;
}

[data-theme="light"] .technologies,
.theme-light .technologies {
    background: #f8fafc !important;
}

[data-theme="light"] .contact,
.theme-light .contact {
    background: #f8fafc !important;
}

[data-theme="light"] .footer,
.theme-light .footer {
    background: #f8fafc !important;
    border-top: 1px solid rgba(0, 163, 255, 0.3) !important;
}

/* Fallback styles for browsers without CSS custom properties support */
.theme-toggle {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #b8c5d6 !important;
}

.language-switch {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #b8c5d6 !important;
}

[data-theme="light"] .theme-toggle,
.theme-light .theme-toggle {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #475569 !important;
}

[data-theme="light"] .language-switch,
.theme-light .language-switch {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #475569 !important;
}

/* Force visibility for server environments */
.nav-controls, .theme-toggle, .language-switch {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-controls {
    display: flex !important;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 60px;
    /* Fix for iOS Safari touch issues */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Arabic RTL Support */
html[lang="ar"] body {
    font-family: var(--font-arabic);
    direction: rtl;
}

html[lang="ar"] .nav-container {
    direction: rtl;
}

html[lang="ar"] .nav-controls {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: reverse;
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
    margin-left: 0;
    margin-right: 1rem;
}

html[lang="ar"] .nav-menu {
    text-align: center;
    direction: rtl;
}

/* Desktop Arabic nav-menu should stay horizontal */
html[lang="ar"] .nav-menu {
    flex-direction: row-reverse !important;
    -webkit-box-orient: horizontal !important;
    -webkit-box-direction: reverse !important;
    -ms-flex-direction: row-reverse !important;
}

html[lang="ar"] .nav-controls > * {
    margin-left: 0;
    margin-right: 0.5rem;
}

html[lang="ar"] .nav-controls > *:first-child {
    margin-right: 0;
}

html[lang="ar"] .nav-controls > *:last-child {
    margin-right: 0.5rem;
}

/* Desktop Arabic hero layout */
@media (min-width: 1025px) {
    html[lang="ar"] .hero-container {
        grid-template-columns: 1fr 1fr;
        direction: ltr; /* Use LTR to put logo on left */
    }

    html[lang="ar"] .hero-content {
        text-align: right;
        order: 2; /* Content on right */
        direction: rtl; /* Keep Arabic text RTL */
    }

    html[lang="ar"] .hero-visual {
        order: 1; /* Logo on left */
    }
    
    html[lang="ar"] .hero-stats {
        -webkit-box-pack: end;
        -ms-flex-pack: end;
        justify-content: flex-end;
        direction: ltr; /* Keep stats numbers in LTR for readability */
    }
}

/* Remove this conflicting rule for nav-menu */

html[lang="ar"] .footer-content {
    direction: rtl;
}

html[lang="ar"] .footer-links {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: reverse;
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition-normal);
    padding: 1rem 0;
}

.nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
}

.nav-logo .logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-fast);
}

.nav-link:hover::after {
    width: 100%;
}

/* Navigation Icons */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon {
    font-size: 1rem;
    transition: var(--transition-fast);
}

/* Colorful Navigation Icons */
.home-icon {
    color: #4CAF50; /* Green */
}

.about-icon {
    color: #2196F3; /* Blue */
}

.services-icon {
    color: #FF9800; /* Orange */
}

.tech-icon {
    color: #9C27B0; /* Purple */
}

.contact-icon {
    color: #F44336; /* Red */
}

/* Icon hover effects */
.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.nav-link:hover .home-icon {
    color: #66BB6A;
}

.nav-link:hover .about-icon {
    color: #42A5F5;
}

.nav-link:hover .services-icon {
    color: #FFA726;
}

.nav-link:hover .tech-icon {
    color: #AB47BC;
}

.nav-link:hover .contact-icon {
    color: #EF5350;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: var(--transition-fast);
}

/* Navigation Controls */
.nav-controls {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 1rem;
    /* Fallback for older browsers */
    margin-left: 1rem;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-controls > * {
    margin-left: 0.5rem;
}

.nav-controls > *:first-child {
    margin-left: 0;
}

.theme-toggle {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px !important;
    width: 40px !important;
    height: 40px !important;
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: all var(--transition-fast);
    -o-transition: all var(--transition-fast);
    transition: all var(--transition-fast);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--text-secondary) !important;
    /* Remove default button styles */
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 10;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background: var(--primary-color);
    color: white;
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    transform: translateY(-2px);
    outline: none;
}

.language-switch {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px !important;
    padding: 0.5rem 0.75rem !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    -webkit-transition: all var(--transition-fast);
    -o-transition: all var(--transition-fast);
    transition: all var(--transition-fast);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: inline-block !important;
    line-height: 1;
    white-space: nowrap;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 10;
}

.language-switch:hover,
.language-switch:focus {
    background: var(--primary-color);
    color: white;
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    z-index: 2;
    position: relative;
}

.hero-content {
    animation: slideInLeft 1s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typewriter {
    border-right: 3px solid var(--primary-color);
    animation: typewriter 4s steps(12) infinite, blink 1s infinite;
}

.hero-description {
    font-size: 1.125rem;
    color: #9CA3AF;
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 163, 255, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.hero-stats {
    display: flex;
    gap: 3rem;
}

.stat {
    text-align: left;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 2rem;
    animation: slideInRight 1s ease-out;
}

.hero-visual::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    z-index: 0;
}

.floating-elements {
    position: absolute;
    inset: 0;
    opacity: 0.3;
}

.floating-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary-color);
    backdrop-filter: blur(10px);
    animation: float 8s ease-in-out infinite;
    animation-delay: var(--delay);
}

.floating-icon:nth-child(1) { top: 15%; left: 25%; }
.floating-icon:nth-child(2) { top: 25%; right: 15%; }
.floating-icon:nth-child(3) { bottom: 35%; left: 15%; }
.floating-icon:nth-child(4) { bottom: 25%; right: 25%; }
.floating-icon:nth-child(5) { top: 60%; left: 60%; transform: translate(-50%, -50%); }

/* Logo Container */
.logo-container {
    position: relative;
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.logo-glow {
    position: absolute;
    inset: 0;
    background: #00A3FF;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    z-index: 0;
}

.floating-logo {
    position: relative;
    width: 100%;
    max-width: 350px;
    height: auto;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

.glow-orb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 6s ease-in-out infinite;
    z-index: 1;
}

/* Hero Background */
.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

.gradient-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 70%);
}

/* Section Styles */
section:not(.hero) {
    scroll-margin-top: 60px;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    scroll-margin-top: 50px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* About Section */
.about {
    padding: var(--section-padding);
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--grid-gap);
}

.about-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
}

.about-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 163, 255, 0.2);
}

.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    margin: 0 auto 1.5rem;
}

/* Colorful About Icons */
.innovation-icon {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
}

.client-icon {
    background: linear-gradient(135deg, #4ECDC4, #44A08D);
}

.security-icon {
    background: linear-gradient(135deg, #A8EDEA, #FED6E3);
    color: #333;
}

.about-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Services Section */
.services {
    padding: var(--section-padding);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--grid-gap);
}

.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 163, 255, 0.2);
}

.service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

/* Colorful Service Icons */
.mobile-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.cloud-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.ai-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.data-icon {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.service-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.service-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-tag {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

/* Technologies Section */
.technologies {
    padding: var(--section-padding);
    background: var(--bg-secondary);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    justify-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.tech-grid .tech-item:nth-child(6),
.tech-grid .tech-item:nth-child(7),
.tech-grid .tech-item:nth-child(8),
.tech-grid .tech-item:nth-child(9),
.tech-grid .tech-item:nth-child(10) {
    grid-column: span 1;
}

.tech-grid .tech-item:nth-child(6) {
    grid-column: 1;
}

.tech-grid .tech-item:nth-child(7) {
    grid-column: 2;
}

.tech-grid .tech-item:nth-child(8) {
    grid-column: 3;
}

.tech-grid .tech-item:nth-child(9) {
    grid-column: 4;
}

.tech-grid .tech-item:nth-child(10) {
    grid-column: 5;
}

@media (max-width: 1200px) {
    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
    
    .tech-grid .tech-item:nth-child(5),
    .tech-grid .tech-item:nth-child(6),
    .tech-grid .tech-item:nth-child(7),
    .tech-grid .tech-item:nth-child(8),
    .tech-grid .tech-item:nth-child(9),
    .tech-grid .tech-item:nth-child(10) {
        grid-column: span 1;
    }
    
    .tech-grid .tech-item:nth-child(9) {
        grid-column: 2;
    }
    
    .tech-grid .tech-item:nth-child(10) {
        grid-column: 3;
    }
}

@media (max-width: 900px) {
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .tech-grid .tech-item:nth-child(8),
    .tech-grid .tech-item:nth-child(9),
    .tech-grid .tech-item:nth-child(10) {
        grid-column: span 1;
    }
    
    .tech-grid .tech-item:nth-child(10) {
        grid-column: 2;
    }
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
    width: 100%;
    max-width: 160px;
    min-height: 120px;
    aspect-ratio: 1.2 / 1;
}

.tech-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 163, 255, 0.2);
}

.tech-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.tech-item span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

/* Contact Section */
.contact {
    padding: var(--section-padding);
    background: var(--bg-secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
}

.contact-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 163, 255, 0.2);
}

.contact-card .contact-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    margin: 0 auto 1.5rem;
}

.contact-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.contact-link:hover {
    color: var(--accent-color);
}

/* Colorful Contact Icons */
.email-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.phone-icon {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.location-icon {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.linkedin-icon {
    background: linear-gradient(135deg, #0077b5, #00a0dc);
}

.whatsapp-icon {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.calendar-icon {
    background: linear-gradient(135deg, #ff6b6b, #ffa726);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.footer-logo .logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes typewriter {
    0%, 50% { border-right-color: var(--primary-color); }
    51%, 100% { border-right-color: transparent; }
}

@keyframes blink {
    0%, 50% { border-right-color: var(--primary-color); }
    51%, 100% { border-right-color: transparent; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    /* Logo first in mobile stack for both languages */
    .hero-content {
        order: 2;
    }
    
    .hero-visual {
        order: 1;
    }
    
    /* Arabic mobile hero - clone English behavior */
    html[lang="ar"] .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        direction: ltr; /* Use LTR for layout structure like English */
    }
    
    html[lang="ar"] .hero-content {
        text-align: center;
        direction: rtl; /* Keep Arabic text RTL */
    }
    
    html[lang="ar"] .hero-stats {
        justify-content: center;
        direction: ltr; /* Keep stats LTR for readability */
    }
    
    .hero-visual {
        height: 400px;
    }
    
    .contact-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 80px 0;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: rgba(13, 17, 23, 0.98);
        backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        align-items: center; /* Center the menu items */
        padding: 2rem 1rem;
        gap: 0.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    /* Light theme mobile menu */
    [data-theme="light"] .nav-menu,
    .theme-light .nav-menu {
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid rgba(0, 163, 255, 0.3);
    }
    
    .nav-menu .nav-link {
        padding: 1.2rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        font-weight: 600;
        width: 100%;
        max-width: 300px;
        text-align: center;
        gap: 0.75rem;
        border-radius: 8px;
        margin: 0.25rem auto; /* Center the items */
        transition: all 0.3s ease;
        flex-shrink: 0;
    }
    
    .nav-menu .nav-link:hover,
    .nav-menu .nav-link:active,
    .nav-menu .nav-link:focus {
        background: rgba(0, 163, 255, 0.1);
        color: var(--primary-color);
    }
    
    /* Touch/click feedback for mobile */
    .nav-menu .nav-link:active {
        background: rgba(0, 163, 255, 0.2);
        transform: scale(0.98);
    }
    
    .nav-menu .nav-icon {
        font-size: 1.2rem;
    }
    
    /* Arabic mobile menu specific fixes */
    html[lang="ar"] .nav-menu {
        direction: rtl;
        text-align: center;
        padding: 2rem 1rem;
        display: flex !important;
        flex-direction: column-reverse !important;
        -webkit-box-orient: vertical !important;
        -webkit-box-direction: reverse !important;
        -ms-flex-direction: column-reverse !important;
        align-items: center;
        justify-content: flex-start;
    }
    
    html[lang="ar"] .nav-menu .nav-link {
        direction: rtl;
        text-align: center;
        justify-content: center;
        align-items: center;
        padding: 1.2rem 1rem;
        font-size: 1.1rem;
        font-weight: 600;
        width: 100%;
        max-width: 300px;
        display: flex !important;
        font-family: var(--font-arabic);
        line-height: 1.4;
        border-radius: 8px;
        margin: 0.25rem 0;
        transition: all 0.3s ease;
        flex-shrink: 0;
        min-height: 44px;
        gap: 0.75rem;
        flex-direction: row-reverse; /* Icon on right for Arabic */
    }
    
    html[lang="ar"] .nav-menu .nav-link:hover,
    html[lang="ar"] .nav-menu .nav-link:active,
    html[lang="ar"] .nav-menu .nav-link:focus {
        background: rgba(0, 163, 255, 0.1);
        color: var(--primary-color);
    }
    
    html[lang="ar"] .nav-menu .nav-link:active {
        background: rgba(0, 163, 255, 0.2);
        transform: scale(0.98);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-controls {
        gap: 0.5rem;
        margin-left: 0.5rem;
    }
    
    html[lang="ar"] .nav-controls {
        margin-left: 0;
        margin-right: 0.5rem;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: reverse;
        -ms-flex-direction: row-reverse;
        flex-direction: row-reverse;
    }
    
    .nav-toggle {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        min-width: 44px;
        min-height: 44px;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }
    
    .theme-toggle,
    .language-switch {
        min-width: 44px;
        min-height: 44px;
        font-size: 0.8rem;
    }
    
    .theme-toggle {
        padding: 0;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }
    
    .language-switch {
        padding: 0.5rem;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        text-align: center;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .hero {
        padding-top: 100px; /* Increased padding to prevent header overlap */
    }
    
    .hero-container {
        padding: 0 1rem;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
        text-align: center;
    }
    
    .hero-description {
        text-align: center;
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    /* Arabic mobile hero elements - simplified */
    html[lang="ar"] .hero-title,
    html[lang="ar"] .hero-description,
    html[lang="ar"] .hero-badge {
        direction: rtl;
        text-align: center;
    }
    
    .hero-visual {
        height: 300px;
        padding: 0;
        justify-content: center;
    }
    
    .services-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: 400px;
    }
    
    .tech-item {
        max-width: 140px;
        min-height: 100px;
        padding: 1rem 0.75rem;
    }
    
    .tech-item i {
        font-size: 2rem;
    }
    
    .tech-item span {
        font-size: 0.85rem;
    }
    
    .tech-grid .tech-item:nth-child(9),
    .tech-grid .tech-item:nth-child(10) {
        grid-column: span 1;
    }
    
    .floating-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .logo-container {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    html {
        scroll-padding-top: 60px;
    }
    

    
    section:not(.hero) {
        scroll-margin-top: 60px;
    }
    
    .section-badge {
        scroll-margin-top: 70px;
    }
    
    .hero {
        padding-top: 90px; /* Increased padding to prevent header overlap */
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    html[lang="ar"] .nav-container {
        direction: rtl;
    }
    
    .nav-menu {
        top: 70px;
        padding: 1.5rem;
    }
    
    .hero-visual {
        height: 250px;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 10vw, 2rem);
    }
    
    .hero-stats {
        gap: 1rem;
    }
    
    .stat {
        text-align: center;
    }
    
    .floating-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .logo-container {
        width: 180px;
        height: 180px;
    }
    
    .service-card,
    .contact-card {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .tech-grid {
        max-width: 350px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Animation for elements coming into view */
.animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.about-card,
.service-card,
.tech-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Navbar scroll effect */
.navbar.scrolled {
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 163, 255, 0.1);
} 