/* CSS Variables for Theming */
:root {
    --primary-color: #8a2be2;
    --primary-light: #b57bff;
    --primary-dark: #5d00a8;
    --secondary-color: #00ffff;
    --dark-bg: #0a0a0f;
    --dark-card: #12121f;
    --light-bg: #f8f9ff;
    --light-card: #ffffff;
    --text-dark: #111111;
    --text-light: #f0f0f0;
    --gray: #8a8a9e;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --shadow: 0 10px 30px rgba(138, 43, 226, 0.2);
    --neon-glow: 0 0 10px rgba(138, 43, 226, 0.7), 0 0 20px rgba(138, 43, 226, 0.5), 0 0 30px rgba(138, 43, 226, 0.3);
    --nav-blur: blur(15px);
}

/* Import Cairo font for Arabic */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* Apply Cairo font when language is Arabic */
[data-lang="ar"] body,
[data-lang="ar"] .section-subtitle,
[data-lang="ar"] .service-card p,
[data-lang="ar"] .about-text p,
[data-lang="ar"] .team-info p,
[data-lang="ar"] .project-info p,
[data-lang="ar"] .contact-info > p,
[data-lang="ar"] .contact-item p,
[data-lang="ar"] .footer-logo p,
[data-lang="ar"] .footer-column a,
[data-lang="ar"] .footer-bottom,
[data-lang="ar"] .hero-subtitle,
[data-lang="ar"] .form-group label,
[data-lang="ar"] button,
[data-lang="ar"] .btn-primary,
[data-lang="ar"] .btn-secondary {
    font-family: 'Cairo', 'Poppins', sans-serif;
}

/* Arabic text alignment */
[data-lang="ar"] .hero-content,
[data-lang="ar"] .about-text,
[data-lang="ar"] .contact-info,
[data-lang="ar"] .footer-column {
    
}

[data-lang="ar"] .hero-buttons,
[data-lang="ar"] .stats,
[data-lang="ar"] .slider-controls {
    direction: ltr; /* Keep buttons LTR even in RTL */
}

/* Dark Theme (Default) */
[data-theme="dark"] {
    --background: var(--dark-bg);
    --card-bg: var(--dark-card);
    --text-color: var(--text-light);
    --text-secondary: var(--gray);
    --nav-bg: rgba(10, 10, 15, 0.95);
}

/* Light Theme */
[data-theme="light"] {
    --background: var(--light-bg);
    --card-bg: var(--light-card);
    --text-color: var(--text-dark);
    --text-secondary: #666666;
    --nav-bg: rgba(248, 249, 255, 0.95);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    direction: ltr;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
    direction: ltr;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    display: block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.5px;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(138, 43, 226, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(138, 43, 226, 0.1);
    transform: translateY(-3px);
}

.btn-secondary.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Navigation - IMPROVED */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.2rem 0;
    background-color: var(--nav-bg);
    backdrop-filter: var(--nav-blur);
    -webkit-backdrop-filter: var(--nav-blur);
    transition: var(--transition);
    border-bottom: 2px solid rgba(138, 43, 226, 0.3);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .navbar {
    background-color: rgba(10, 10, 15, 0.95);
}

[data-theme="light"] .navbar {
    background-color: rgba(248, 249, 255, 0.98);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 0 8px var(--primary-color));
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    background: transparent !important;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding: 8px 0;
    transition: var(--transition);
    background: transparent !important;
    border: none !important;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: transparent !important;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    transition: var(--transition);
}

.hamburger:hover {
    transform: scale(1.1);
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: var(--text-color);
    transition: var(--transition);
    border-radius: 2px;
    display: block;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 100px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%, rgba(138, 43, 226, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(0, 255, 255, 0.1) 0%, transparent 50%);
}

.hero-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
    text-align: left;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 500px;
    text-align: left;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* 3D Cube - IMPROVED ANIMATION */
.cube-container {
    position: relative;
    width: 300px;
    height: 300px;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.cube {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: rotateCube 20s infinite linear;
    transform: rotateX(-15deg) rotateY(-15deg);
}

/* Smooth, multi-directional rotation */
@keyframes rotateCube {
    0% { 
        transform: rotateX(-15deg) rotateY(0deg) rotateZ(0deg); 
    }
    25% { 
        transform: rotateX(45deg) rotateY(90deg) rotateZ(0deg); 
    }
    50% { 
        transform: rotateX(105deg) rotateY(180deg) rotateZ(0deg); 
    }
    75% { 
        transform: rotateX(165deg) rotateY(270deg) rotateZ(0deg); 
    }
    100% { 
        transform: rotateX(-15deg) rotateY(360deg) rotateZ(0deg); 
    }
}

/* Alternative flip animation */
@keyframes flipCube {
    0% { 
        transform: rotateX(0deg) rotateY(0deg); 
    }
    25% { 
        transform: rotateX(90deg) rotateY(0deg); 
    }
    50% { 
        transform: rotateX(90deg) rotateY(90deg); 
    }
    75% { 
        transform: rotateX(0deg) rotateY(90deg); 
    }
    100% { 
        transform: rotateX(0deg) rotateY(0deg); 
    }
}

.cube-face {
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(138, 43, 226, 0.08);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary-color);
    box-shadow: 
        inset 0 0 30px rgba(138, 43, 226, 0.3),
        0 0 20px rgba(138, 43, 226, 0.2);
    backdrop-filter: blur(5px);
    transform-style: preserve-3d;
    transition: all 0.3s ease;
}

/* Better 3D positioning with subtle depth differences */
.cube-face.front { 
    transform: translateZ(150px);
    background: rgba(138, 43, 226, 0.12);
}

.cube-face.back { 
    transform: translateZ(-150px) rotateY(180deg);
    background: rgba(138, 43, 226, 0.1);
}

.cube-face.right { 
    transform: rotateY(90deg) translateZ(150px);
    background: rgba(138, 43, 226, 0.14);
}

.cube-face.left { 
    transform: rotateY(-90deg) translateZ(150px);
    background: rgba(138, 43, 226, 0.14);
}

.cube-face.top { 
    transform: rotateX(90deg) translateZ(150px);
    background: rgba(138, 43, 226, 0.08);
}

.cube-face.bottom { 
    transform: rotateX(-90deg) translateZ(150px);
    background: rgba(138, 43, 226, 0.08);
}

.cube-face i, .cube-face span {
    text-shadow: 
        0 0 15px var(--primary-color),
        0 0 30px rgba(138, 43, 226, 0.5);
    filter: brightness(1.2);
    transition: transform 0.3s ease;
}

.cube-face:hover i,
.cube-face:hover span {
    transform: scale(1.2);
    text-shadow: 
        0 0 20px var(--primary-color),
        0 0 40px rgba(138, 43, 226, 0.7);
}

.cube-shadow {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 60px;
    background: radial-gradient(ellipse at center, 
        rgba(138, 43, 226, 0.4) 0%, 
        rgba(138, 43, 226, 0.2) 30%,
        transparent 70%);
    border-radius: 50%;
    filter: blur(15px);
    animation: pulseShadow 3s ease-in-out infinite alternate;
}

@keyframes pulseShadow {
    0% {
        opacity: 0.7;
        transform: translateX(-50%) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1.05);
    }
}

/* Services Section */
.services {
    padding: 100px 0;
    position: relative;
}

.services::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    transition: var(--transition);
    border: 1px solid rgba(138, 43, 226, 0.1);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: rgba(138, 43, 226, 0.2);
    transform: rotateY(180deg);
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.service-card p {
    color: var(--text-secondary);
    text-align: center;
}

/* About Section */
.about {
    padding: 100px 0;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    text-align: left;
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.stat {
    text-align: center;
    flex: 1;
    min-width: 100px;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    line-height: 1;
}

.stat-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.5rem;
}

.team-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.team-card {
    display: flex;
    gap: 1.5rem;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    transition: var(--transition);
    border: 1px solid rgba(138, 43, 226, 0.1);
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.team-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    flex-shrink: 0;
    transition: var(--transition);
}

.team-card:hover .team-img {
    border-color: var(--secondary-color);
    transform: scale(1.05);
}

.team-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.team-card:hover .team-img img {
    transform: scale(1.1);
}

.placeholder-img {
    width: 100%;
    height: 100%;
    background: rgba(138, 43, 226, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color);
}

.team-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: left;
}

.team-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: left;
}

.team-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.team-skills span {
    background: rgba(138, 43, 226, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.team-card:hover .team-skills span {
    background: rgba(138, 43, 226, 0.2);
    transform: translateY(-2px);
}

/* Portfolio Section */
.portfolio {
    padding: 100px 0;
    position: relative;
}

.portfolio::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.slider-container {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid rgba(138, 43, 226, 0.1);
}

.project-img {
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-img:hover img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-img:hover .project-overlay {
    opacity: 1;
}

.project-link {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
    transition: var(--transition);
}

.project-link:hover {
    background: var(--secondary-color);
    transform: scale(1.1) rotate(15deg);
}

.coming-soon {
    width: 100%;
    height: 100%;
    background: rgba(138, 43, 226, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 2rem;
}

.coming-soon span {
    font-size: 1.5rem;
    margin-top: 1rem;
    font-family: 'Orbitron', sans-serif;
}

.project-info {
    flex: 1;
    text-align: center;
}

.project-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.project-tags span {
    background: rgba(138, 43, 226, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.slider-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.slider-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid rgba(138, 43, 226, 0.3);
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.slider-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.slider-dots {
    display: flex;
    gap: 1rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

/* Contact Section */
.contact {
    padding: 100px 0;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.contact-info > p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    text-align: left;
}

.contact-details {
    margin-bottom: 2.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 5px;
}

.contact-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.contact-item p {
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.2rem;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px);
    box-shadow: var(--neon-glow);
}

.contact-form {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid rgba(138, 43, 226, 0.1);
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    pointer-events: none;
    background: var(--card-bg);
    padding: 0 0.5rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -0.6rem;
    left: 0.8rem;
    font-size: 0.9rem;
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--dark-card);
    padding: 60px 0 30px;
    border-top: 1px solid rgba(138, 43, 226, 0.1);
}

[data-theme="light"] .footer {
    background: #f0f0f9;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    text-align: left;
}

.footer-logo img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.footer-logo p {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: left;
}

.footer-column h4 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.footer-column a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 0.8rem;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(138, 43, 226, 0.1);
    color: var(--text-secondary);
    font-size: 0.9rem;
}
/* =========================================== */
/* FLOATING CONTROLS - VERTICAL STACK */
/* =========================================== */

.floating-controls {
    position: fixed;
    right: 30px;
    top: 70%; /* Changed from 30% to 70% (30% from bottom) */
    z-index: 1000;
}

.floating-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.floating-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.4);
    position: relative;
    overflow: hidden;
}

.floating-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.floating-btn:hover::before {
    transform: scale(1);
}

.floating-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.6);
}

.floating-btn .lang-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 1rem;
}

.floating-btn.theme-toggle {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(138, 43, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(138, 43, 226, 0);
    }
}

/* =========================================== */
/* RESPONSIVE DESIGN */
/* =========================================== */

/* Desktop */
@media (max-width: 1200px) {
    .container {
        padding: 0 40px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .cube-container {
        width: 280px;
        height: 280px;
    }
    
    .cube-face {
        width: 280px;
        height: 280px;
    }
    
    .cube-face.front { transform: translateZ(140px); }
    .cube-face.back { transform: translateZ(-140px) rotateY(180deg); }
    .cube-face.right { transform: rotateY(90deg) translateZ(140px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(140px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(140px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(140px); }
    
    .floating-controls {
        right: 25px;
        top: 70%; /* Changed from 25% to 70% */
    }

    .project-img {
        height: 250px;
        overflow: visible; /* Show full image without clipping */
    }
    
    .project-img img {
        object-fit: contain; /* Show entire image (no cropping) */
        object-position: center;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .container {
        padding: 0 30px;
    }
    
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-content {
        max-width: 100%;
        text-align: center;
    }
    
    .hero-title {
        text-align: center;
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-buttons {
        justify-content: center;
        text-align: center;
    }
    
    .cube-container {
        width: 220px;
        height: 220px;
        order: -1;
    }
    
    .cube-face {
        width: 220px;
        height: 220px;
        font-size: 2.5rem;
    }
    
    .cube-face.front { transform: translateZ(110px); }
    .cube-face.back { transform: translateZ(-110px) rotateY(180deg); }
    .cube-face.right { transform: rotateY(90deg) translateZ(110px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(110px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(110px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(110px); }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .about-text p {
        text-align: center;
    }
    
    .team-card {
        text-align: center;
        flex-direction: column;
        align-items: center;
    }
    
    .team-info h3,
    .team-info p {
        text-align: center;
    }
    
    .team-skills {
        justify-content: center;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .contact-info h3,
    .contact-info > p {
        text-align: center;
    }
    
    .contact-item {
        text-align: center;
        flex-direction: column;
        align-items: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .footer-logo {
        text-align: center;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .floating-controls {
        right: 20px;
        top: 70%; /* Changed from 25% to 70% */
    }
    
    .floating-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
}

/* Large Mobile - IMPROVED NAVBAR */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    /* Navbar fixes for all mobile sizes */
    .navbar {
        padding: 0.8rem 0 !important;
        height: 70px;
        background-color: rgba(10, 10, 15, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        border-bottom: 2px solid rgba(138, 43, 226, 0.4);
    }
    
    [data-theme="light"] .navbar {
        background-color: rgba(255, 255, 255, 0.98) !important;
    }
    
    .nav-container {
        padding: 0 20px !important;
        height: 100%;
    }
    
    .logo-img {
        height: 40px !important;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 15, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem 0;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 999;
        gap: 1.5rem;
    }
    
    [data-theme="light"] .nav-menu {
        background: rgba(255, 255, 255, 0.98) !important;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        font-size: 1.3rem;
        padding: 1rem 2.5rem;
        background: rgba(138, 43, 226, 0.15) !important;
        border-radius: 50px;
        width: 250px;
        text-align: center;
        border: 2px solid rgba(138, 43, 226, 0.3) !important;
        transition: all 0.3s ease;
    }
    
    .nav-link:hover {
        background: rgba(138, 43, 226, 0.25) !important;
        transform: translateY(-3px);
        box-shadow: 0 5px 15px rgba(138, 43, 226, 0.3);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .hamburger {
        display: flex;
        padding: 8px;
    }
    
    .hamburger span {
        width: 26px;
        height: 3px;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    /* Smaller cube for tablets */
    .cube-container {
        width: 200px;
        height: 200px;
    }
    
    .cube-face {
        width: 200px;
        height: 200px;
        font-size: 2rem;
    }
    
    .cube-face.front { transform: translateZ(100px); }
    .cube-face.back { transform: translateZ(-100px) rotateY(180deg); }
    .cube-face.right { transform: rotateY(90deg) translateZ(100px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(100px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(100px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(100px); }
    
    .cube-shadow {
        width: 160px;
        bottom: -40px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .slide {
        padding: 1.5rem;
    }
    
    /* FIXED: Project image for 768px - ensure full visibility */
    .project-img {
        height: 250px;
        overflow: visible; /* Changed from hidden */
        position: relative;
    }
    
    .project-img img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Changed from cover to contain */
        object-position: center;
    }
    
    .project-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(10, 10, 15, 0.8);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .floating-controls {
        right: 15px;
        top: 70%; /* Changed from 25% to 70% */
    }
    
    .floating-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .floating-btn {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
        animation: none;
    }
    
    .floating-btn:hover {
        transform: translateY(-3px) scale(1.05);
    }
}

/* Medium Mobile - 480px */
@media (max-width: 480px) {
    .hero {
        padding-top: 80px;
        min-height: 90vh;
    }
    
    .hero-container {
        flex-direction: column;
        text-align: center;
        padding: 0 15px;
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
        position: relative;
        z-index: 10; /* Higher than cube's z-index */
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 2rem;
        padding: 0 5px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding: 0 10px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
        padding: 12px 20px;
        font-size: 0.9rem;
        margin: 0 auto;
    }
    
    /* Smaller cube for mobile */
    .cube-container {
        width: 180px;
        height: 180px;
        margin: 0 auto;
    }
    
    .cube-face {
        width: 180px;
        height: 180px;
        font-size: 1.8rem;
    }
    
    .cube-face.front { transform: translateZ(90px); }
    .cube-face.back { transform: translateZ(-90px) rotateY(180deg); }
    .cube-face.right { transform: rotateY(90deg) translateZ(90px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(90px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(90px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(90px); }
    
    .cube-shadow {
        width: 140px;
        bottom: -35px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .stats {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .stat {
        min-width: 120px;
    }
    
    .team-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .team-img {
        width: 120px;
        height: 120px;
    }
    
    .slide {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .project-img {
        height: 200px;
    }
    
    .slider-controls {
        margin-top: 1.5rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Navbar fixes for 480px */
    .navbar {
        padding: 0.7rem 0 !important;
        height: 65px;
    }
    
    .nav-container {
        padding: 0 15px !important;
    }
    
    .logo-img {
        height: 38px !important;
    }
    
    .hamburger {
        padding: 7px;
    }
    
    .hamburger span {
        width: 25px;
        height: 2.8px;
    }
    
    .nav-link {
        font-size: 1.2rem;
        padding: 0.9rem 2rem;
        width: 220px;
    }
    
    .floating-controls {
        right: 12px;
        top: 70%; /* Changed from 25% to 70% */
    }
    
    .floating-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 1rem;
        animation: none;
    }
}

/* Small Mobile - 375px */
@media (max-width: 375px) {
    .navbar {
        padding: 0.6rem 0 !important;
        height: 60px;
    }
    
    .nav-container {
        padding: 0 12px !important;
    }
    
    .logo-img {
        height: 35px !important;
    }
    
    .hamburger {
        padding: 6px;
    }
    
    .hamburger span {
        width: 24px;
        height: 2.5px;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 0.8rem 1.8rem;
        width: 200px;
        margin: 0.3rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
        position: relative;
        z-index: 10; /* Higher than cube's z-index */
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .btn-primary, .btn-secondary {
        max-width: 250px;
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    /* Smaller cube for 375px */
    .cube-container {
        width: 160px;
        height: 160px;
    }
    
    .cube-face {
        width: 160px;
        height: 160px;
        font-size: 1.6rem;
    }
    
    .cube-face.front { transform: translateZ(80px); }
    .cube-face.back { transform: translateZ(-80px) rotateY(180deg); }
    .cube-face.right { transform: rotateY(90deg) translateZ(80px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(80px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(80px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(80px); }
    
    .cube-shadow {
        width: 120px;
        bottom: -30px;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .team-card {
        padding: 1.2rem;
    }
    
    .project-info h3 {
        font-size: 1.5rem;
    }
    
    .contact-container {
        gap: 2rem;
    }
    
    .floating-controls {
        right: 10px;
        top: 70%; /* Changed from 25% to 70% */
    }
    
    .floating-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .floating-btn {
        width: 45px;
        height: 45px;
        font-size: 0.95rem;
        animation: none;
    }
}

/* Extra Small Mobile - 320px */
@media (max-width: 320px) {
    .navbar {
        padding: 0.5rem 0 !important;
        height: 55px;
    }
    
    .nav-container {
        padding: 0 10px !important;
    }
    
    .logo-img {
        height: 32px !important;
    }
    
    .hamburger {
        padding: 5px;
        transform: scale(0.9);
    }
    
    .hamburger span {
        width: 22px;
        height: 2px;
    }
    
    .nav-menu {
        padding-top: 70px;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.7rem 1.5rem;
        width: 180px;
        margin: 0.2rem 0;
    }
    
    .container {
        padding: 0 10px !important;
    }
    
    .hero {
        padding-top: 60px;
        min-height: 85vh;
    }
    
    .hero-title {
        font-size: 1.5rem;
        line-height: 1.1;
        margin-bottom: 0.8rem;
        position: relative;
        z-index: 10; /* Higher than cube's z-index */
    }
    
    .hero-subtitle {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 1.5rem;
    }
    
    .btn-primary, .btn-secondary {
        max-width: 200px;
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    /* Smallest cube for 320px */
    .cube-container {
        width: 40px;
        height: 40px;
        margin: 0 auto;
    }
    
    .cube-face {
        width: 140px;
        height: 1400px;
        font-size: 1.4rem;
    }
    
    .cube-face.front { transform: translateZ(70px); }
    .cube-face.back { transform: translateZ(-70px) rotateY(180deg); }
    .cube-face.right { transform: rotateY(90deg) translateZ(70px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(70px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(70px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(70px); }
    
    .cube-shadow {
        width: 100px;
        bottom: -25px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
        padding: 0 5px;
    }
    
    /* Service cards */
    .service-card {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .service-card h3 {
        font-size: 1.2rem;
    }
    
    .service-card p {
        font-size: 0.8rem;
    }
    
    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    /* Team section */
    .team-card {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .team-img {
        width: 80px;
        height: 80px;
    }
    
    .team-info h3 {
        font-size: 1.1rem;
    }
    
    .team-info p {
        font-size: 0.75rem;
    }
    
    /* Portfolio */
    .project-img {
        height: 170px;
    }
    
    .project-info h3 {
        font-size: 1.3rem;
    }
    
    .project-tags span {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Contact form */
    .contact-form {
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group input, 
    .form-group textarea {
        padding: 0.7rem;
        font-size: 0.85rem;
    }
    
    /* Floating controls */
    .floating-controls {
        right: 8px;
        top: 70%; /* Changed from 25% to 70% */
    }
    
    .floating-buttons {
        flex-direction: column;
        gap: 6px;
    }
    
    .floating-btn {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
        animation: none;
    }
    
    .floating-btn .lang-text {
        font-size: 0.75rem;
    }
    
    /* Footer */
    .footer {
        padding: 30px 0 15px;
    }
    
    .footer-logo img {
        height: 35px;
    }
    
    .footer-column h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .footer-column a {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }
}

/* Mobile Portrait - 400px */
@media (max-width: 400px) {
    .navbar {
        padding: 0.6rem 0 !important;
        height: 62px;
    }
    
    .nav-container {
        padding: 0 14px !important;
    }
    
    .logo-img {
        height: 36px !important;
    }
    
    .hamburger {
        padding: 6px;
    }
    
    .hamburger span {
        width: 24px;
        height: 2.5px;
    }
    
    /* Cube size for 400px */
    .cube-container {
        width: 170px;
        height: 170px;
    }
    
    .cube-face {
        width: 170px;
        height: 170px;
        font-size: 1.4rem;
    }
    
    .cube-face.front { transform: translateZ(85px); }
    .cube-face.back { transform: translateZ(-85px) rotateY(180deg); }
    .cube-face.right { transform: rotateY(90deg) translateZ(85px); }
    .cube-face.left { transform: rotateY(-90deg) translateZ(85px); }
    .cube-face.top { transform: rotateX(90deg) translateZ(85px); }
    .cube-face.bottom { transform: rotateX(-90deg) translateZ(85px); }
    
    .cube-shadow {
        width: 130px;
        bottom: -32px;
    }
    
    .floating-controls {
        right: 10px;
        top: 70%; /* Changed from 25% to 70% */
    }
    
    .floating-btn {
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
        animation: none;
    }
}
[data-lang="ar"] {
    font-family: 'Cairo', Arial, sans-serif;
    direction: rtl;
}