/* CSS Variables for easy theme management */
:root {
    --bg-dark: #0a0f1c;
    --bg-light-dark: #1a2332;
    --accent-color: #00ffd5;
    --secondary-accent: #00a8cc;
    --text-light: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: rgba(0, 255, 213, 0.2);
    --card-bg: rgba(255, 255, 255, 0.05);
    --header-bg: rgba(10, 15, 28, 0.95);
    --header-scrolled-bg: rgba(10, 15, 28, 0.98);
    --font-family: 'Poppins', sans-serif;
}

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

/* FIX 1: Add overflow safety to HTML root */
html {
    width: 100%;
    /* Ensure no tiny rendering gap exists */
    box-sizing: border-box;
    overflow-x: hidden;
    /* Crucial containment layer */
}

body {
    font-family: var(--font-family);
    background: var(--bg-dark);
    color: var(--text-light);

    /* Keep this existing rule, but ensure HTML also has it */
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
    /* FIX 2: Ensure the body doesn't try to shrink smaller than mobile content */
    min-width: 320px;
}


/* ... */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* --- Language Switcher Styles (Add this at the end) --- */
.language-switcher {
    position: relative;
    margin-left: 20px;
    /* Adjust spacing */
    z-index: 1001;
    /* Ensure it's above nav links */
}

.selected-lang {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.selected-lang:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 213, 0.3);
}

.lang-flag {
    font-size: 1.2rem;
    margin-right: 8px;
}

.lang-text {
    font-weight: 500;
    color: var(--text-light);
}

.selected-lang .fa-chevron-down {
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.language-switcher.active .selected-lang .fa-chevron-down {
    transform: rotate(180deg);
}

.lang-options {
    list-style: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--header-scrolled-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 10px;
    width: 120px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.language-switcher.active .lang-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-options li {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 10px;
    transition: background-color 0.3s ease;
    color: var(--text-light);
}

.lang-options li:hover {
    background-color: rgba(0, 255, 213, 0.1);
    color: var(--accent-color);
}

/* Responsive adjustments for switcher */
@media (max-width: 1024px) {
    .language-switcher {
        margin-left: 0;
        margin-right: 20px;
        /* Space between switcher and hamburger */
    }
}

.mobile-nav .language-switcher {
    display: none;
    /* Hide by default in mobile nav */
}

@media (max-width: 768px) {
    .header>.language-switcher {
        display: none;
        /* Hide from header on small screens */
    }

    .mobile-nav .language-switcher {
        display: block;
        /* Show in mobile nav */
        margin-top: 30px;
        width: 80%;
    }

    .mobile-nav .lang-options {
        width: 100%;
    }
}

/* body {
            font-family: var(--font-family);
            background: var(--bg-dark);
            color: var(--text-light);
            overflow-x: hidden;
            line-height: 1.6;
            position: relative;
        } */

/* Subtle Noise Overlay for texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAwIDIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDZkZWYgZmlsdGVyIGlkPSJub2lzZUZpbHRlciI+CiAgICAgICAgPGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuNzUiIG51bU9jdGFhdmVzPSI0IiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+CiAgICAgICAgPGZlQ29sb3JNYXRyaXggdHlwZT0ic2F0dXJhdGUiIHZhbHVlcz0iMCIvPgogICAgPC9kZWY+CiAgICA8cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsZXItdXJsPSJ1cmwoI21peGVkTm9pc2UiIG9wYWNpdHk9IjAuMDMiPjwvcmVjdD4KPC9zdmc+') repeat;
    opacity: 0.03;
    pointer-events: none;
    z-index: 2;
}

/* Animated background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(45deg, var(--bg-dark) 0%, var(--bg-light-dark) 25%, #0f1419 50%, #1e2a3a 75%, var(--bg-dark) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
    opacity: 0.6;
    box-shadow: 0 0 8px var(--accent-color);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg) scale(1);
        opacity: 0.6;
    }

    25% {
        transform: translateY(-30px) rotate(90deg) scale(1.2);
        opacity: 1;
    }

    50% {
        transform: translateY(-60px) rotate(180deg) scale(0.8);
        opacity: 0.4;
    }

    75% {
        transform: translateY(-30px) rotate(270deg) scale(1.1);
        opacity: 0.8;
    }
}

/* Header Navigation */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.header.scrolled {
    padding: 15px 50px;
    background: var(--header-scrolled-bg);
    box-shadow: 0 10px 30px rgba(0, 255, 213, 0.15);
}

.logo {
    width: 60px;
    height: 60px;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    color: var(--accent-color);
    background: rgba(0, 255, 213, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 255, 213, 0.3);
}

.logo::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, transparent, var(--accent-color), transparent);
    animation: rotate 3s linear infinite;
    border-radius: 50%;
    filter: blur(5px);
}

.logo span {
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(0, 255, 213, 0.7);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.desktop-nav .nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.desktop-nav .nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 30px;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    font-weight: 500;
    overflow: hidden;
}

.desktop-nav .nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 255, 213, 0.2), rgba(0, 168, 204, 0.2));
    border-radius: 30px;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: scale(0.8);
    z-index: -1;
}

.desktop-nav .nav-links a:hover::before,
.desktop-nav .nav-links a.active::before {
    opacity: 1;
    transform: scale(1);
}

.desktop-nav .nav-links a:hover,
.desktop-nav .nav-links a.active {
    color: var(--accent-color);
    transform: translateY(-3px);
    text-shadow: 0 0 20px rgba(0, 255, 213, 0.5);
}

/* Hamburger Menu for Mobile */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background: var(--header-scrolled-bg);
    backdrop-filter: blur(30px);
    padding-top: 100px;
    transition: right 0.4s ease-in-out;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 255, 213, 0.15);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav .nav-links {
    flex-direction: column;
    gap: 25px;
    width: 100%;
    text-align: center;
    list-style: none;
    /* Ensure no bullets */
}

.mobile-nav .nav-links a {
    padding: 15px 0;
    width: 80%;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--text-light);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    font-weight: 500;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.mobile-nav .nav-links a:hover,
.mobile-nav .nav-links a.active {
    color: var(--accent-color);
    background: linear-gradient(45deg, rgba(0, 255, 213, 0.2), rgba(0, 168, 204, 0.2));
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 255, 213, 0.2);
}


/* All sections with proper spacing */
section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 50px 80px;
}

/* Section Headings */
h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    background: linear-gradient(45deg, var(--accent-color), var(--text-light), var(--secondary-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    text-align: center;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    border-radius: 2px;
}


/* Hero Section */
.hero {
    background: radial-gradient(ellipse at center, rgba(0, 255, 213, 0.05) 0%, transparent 70%);
    padding-top: 180px;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 100px;
    max-width: 1400px;
    width: 100%;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.profile-section {
    position: relative;
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

/* Abstract Data Cube Visual */
.abstract-hero-visual {
    position: relative;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    animation: cubeRotate 15s infinite linear;
    box-shadow: 0 0 40px rgba(0, 255, 213, 0.4);
    border-radius: 15px;
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(0, 255, 213, 0.1);
    border: 1px solid var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent-color);
    opacity: 0.8;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 255, 213, 0.3);
    border-radius: 5px;
    /* Slightly rounded edges for the cube faces */
}

.cube-face:hover {
    background: rgba(0, 255, 213, 0.2);
    opacity: 1;
    box-shadow: inset 0 0 20px rgba(0, 255, 213, 0.5);
}

.cube-front {
    transform: rotateY(0deg) translateZ(100px);
}

.cube-back {
    transform: rotateY(180deg) translateZ(100px);
}

.cube-right {
    transform: rotateY(90deg) translateZ(100px);
}

.cube-left {
    transform: rotateY(-90deg) translateZ(100px);
}

.cube-top {
    transform: rotateX(90deg) translateZ(100px);
}

.cube-bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

.cube-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    filter: blur(25px);
    opacity: 0.6;
    animation: pulseGlow 4s infinite ease-in-out;
    z-index: -1;
    border-radius: 20px;
}


@keyframes cubeRotate {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

@keyframes pulseGlow {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}


.floating-elements {
    position: absolute;
    width: 350px;
    height: 350px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.floating-element {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 213, 0.1);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    animation: orbit 10s linear infinite;
    box-shadow: 0 0 15px rgba(0, 255, 213, 0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.floating-element:nth-child(1) {
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    animation-delay: -2.5s;
}

.floating-element:nth-child(3) {
    animation-delay: -5s;
}

.floating-element:nth-child(4) {
    animation-delay: -7.5s;
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(150px) rotate(0deg);
        opacity: 0.8;
    }

    25% {
        transform: rotate(90deg) translateX(150px) rotate(-90deg);
        opacity: 1;
    }

    50% {
        transform: rotate(180deg) translateX(150px) rotate(-180deg);
        opacity: 0.8;
    }

    75% {
        transform: rotate(270deg) translateX(150px) rotate(-270deg);
        opacity: 1;
    }

    100% {
        transform: rotate(360deg) translateX(150px) rotate(-360deg);
        opacity: 0.8;
    }
}

.hero-text {
    flex: 1;
    max-width: 600px;
    text-align: left;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, var(--accent-color), var(--text-light), var(--secondary-accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    line-height: 1.1;
}

.hero-role {
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--text-muted);
    font-weight: 300;
    min-height: 2.4rem;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: var(--text-light);
}

.tech-stack {
    display: flex;
    gap: 12px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.tech-tag {
    background: rgba(0, 255, 213, 0.1);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 255, 213, 0.3);
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}

.tech-tag:hover {
    background: rgba(0, 255, 213, 0.2);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 255, 213, 0.2);
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.btn {
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.4s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-accent));
    color: var(--bg-dark);
    box-shadow: 0 10px 30px rgba(0, 255, 213, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 0 rgba(0, 255, 213, 0);
}

.btn-secondary:hover {
    background: var(--accent-color);
    color: var(--bg-dark);
}

.btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 255, 213, 0.4);
}

/* About Section */
.about {
    background: linear-gradient(135deg, rgba(0, 255, 213, 0.05) 0%, rgba(0, 168, 204, 0.05) 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    max-width: 1200px;
    align-items: center;
}

.about-text h2 {
    text-align: left;
}

.about-text h2::after {
    left: 0;
    transform: translateX(0);
}

.about-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 213, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px rgba(0, 255, 213, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

/* Skills Section */
.skills {
    background: radial-gradient(ellipse at center, rgba(0, 255, 213, 0.03) 0%, transparent 70%);
}

.skills-content {
    max-width: 1200px;
    text-align: center;
}

.skills-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 60px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.skill-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 40px 25px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    perspective: 1000px;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 213, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.skill-card:hover {
    transform: translateY(-15px) scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 25px 50px rgba(0, 255, 213, 0.3);
}

.skill-card:hover::before {
    opacity: 1;
}

.skill-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    border: 3px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--accent-color);
    position: relative;
    z-index: 1;
    background: rgba(0, 255, 213, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 213, 0.3);
    transition: all 0.3s ease;
}

.skill-card:hover .skill-icon {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 25px rgba(0, 255, 213, 0.5);
}

.skill-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    color: var(--text-light);
}

.skill-card p {
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

/* Services Section */
.services {
    background: linear-gradient(135deg, rgba(0, 168, 204, 0.05) 0%, rgba(0, 255, 213, 0.05) 100%);
}

.services-content {
    max-width: 1200px;
    text-align: center;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.service-card {
    background: var(--card-bg);
    padding: 50px 30px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    text-align: left;
    perspective: 1000px;
}

.service-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(0, 255, 213, 0.1), transparent);
    opacity: 0;
    transition: all 0.4s ease;
    animation: rotate 3s linear infinite;
    filter: blur(5px);
    z-index: 0;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px rgba(0, 255, 213, 0.2);
}

.service-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-light);
    position: relative;
    z-index: 1;
}

.service-card p {
    color: var(--text-muted);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Portfolio Section */
.portfolio {
    background: radial-gradient(ellipse at center, rgba(0, 255, 213, 0.03) 0%, transparent 70%);
}

.portfolio-content {
    max-width: 1400px;
    text-align: center;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background: var(--card-bg);
    border-radius: 25px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 255, 213, 0.3);
    border-color: var(--accent-color);
}

.project-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(45deg, var(--bg-light-dark), #2a3442);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

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

.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 255, 213, 0.1), rgba(0, 168, 204, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.project-card:hover .project-image::before {
    opacity: 1;
}

.project-info {
    padding: 35px;
    text-align: left;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.project-info p {
    color: var(--text-light);
    margin-bottom: 25px;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-btn {
    padding: 10px 25px;
    background: rgba(0, 255, 213, 0.1);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.project-btn:hover {
    background: var(--accent-color);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 213, 0.3);
}

/* Contact Section */
.contact {
    background: linear-gradient(135deg, rgba(0, 255, 213, 0.05) 0%, rgba(0, 168, 204, 0.05) 100%);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    max-width: 1200px;
    align-items: center;
}

.contact-info {
    text-align: left;
}

.contact-info h2 {
    text-align: left;
}

.contact-info h2::after {
    left: 0;
    transform: translateX(0);
}

.contact-description {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
    line-height: 1.6;
}

.contact-details {
    margin-bottom: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--text-light);
}

.contact-item .icon {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-link {
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 213, 0.1);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--accent-color);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 213, 0.2);
}

.social-link:hover {
    background: var(--accent-color);
    color: var(--bg-dark);
    transform: scale(1.1) rotate(360deg);
    box-shadow: 0 0 20px rgba(0, 255, 213, 0.5);
}

.contact-form {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1.1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(0, 255, 213, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 255, 213, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light-dark) 100%);
    border-top: 1px solid var(--border-color);
    padding: 80px 50px 30px;
    position: relative;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 50px;
}

.footer-brand h3 {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.footer-brand p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 255, 213, 0.1);
    color: var(--text-muted);
}

.footer-bottom p {
    margin-bottom: 10px;
}

/* Scroll animations */
.animated-element {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animated-element.slide-in-left {
    transform: translateX(-100px);
}

.animated-element.slide-in-right {
    transform: translateX(100px);
}

.animated-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animated-element.is-visible.slide-in-left {
    transform: translateX(0);
}

.animated-element.is-visible.slide-in-right {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-content {
        gap: 60px;
    }

    .profile-section {
        width: 300px;
        height: 300px;
    }

    .abstract-hero-visual {
        width: 180px;
        height: 180px;
    }

    .cube-face {
        width: 180px;
        height: 180px;
        transform: translateZ(90px);
        /* Adjust for new cube size */
    }

    .cube-front {
        transform: rotateY(0deg) translateZ(90px);
    }

    .cube-back {
        transform: rotateY(180deg) translateZ(90px);
    }

    .cube-right {
        transform: rotateY(90deg) translateZ(90px);
    }

    .cube-left {
        transform: rotateY(-90deg) translateZ(90px);
    }

    .cube-top {
        transform: rotateX(90deg) translateZ(90px);
    }

    .cube-bottom {
        transform: rotateX(-90deg) translateZ(90px);
    }


    .floating-elements {
        width: 300px;
        height: 300px;
    }

    @keyframes orbit {
        0% {
            transform: rotate(0deg) translateX(125px) rotate(0deg);
        }

        25% {
            transform: rotate(90deg) translateX(125px) rotate(-90deg);
        }

        50% {
            transform: rotate(180deg) translateX(125px) rotate(-180deg);
        }

        75% {
            transform: rotate(270deg) translateX(125px) rotate(-270deg);
        }

        100% {
            transform: rotate(360deg) translateX(125px) rotate(-360deg);
        }
    }
}

@media (max-width: 1024px) {



    .header {
        padding: 15px 30px;
    }

    .desktop-nav {
        display: none;
        /* Hide desktop nav links */
    }

    .hamburger {
        display: flex;
        /* Show hamburger on mobile */
    }

    .hero-content,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 130px;
        text-align: center;
        display: flex;
        flex-direction: column-reverse;
    }

    .hero-text,
    .about-text,
    .contact-info {
        text-align: center;
    }

    .hero-text h2::after,
    .about-text h2::after,
    .contact-info h2::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .profile-section {
        order: -1;
        /* Move visual above text on mobile */
        margin-bottom: 40px;
    }

    .hero-buttons,
    .tech-stack,
    .social-links {
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    h2 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    section {
        padding: 80px 20px 60px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-role {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .skills-grid,
    .services-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .contact-form {
        padding: 30px;
    }

    h2 {
        font-size: 2.2rem;
    }

    .profile-section {
        width: 280px;
        height: 280px;
    }

    .abstract-hero-visual {
        width: 160px;
        height: 160px;
    }

    .cube-face {
        width: 160px;
        height: 160px;
        font-size: 2.5rem;
        /* Adjusted icon size for smaller cube */
        transform: translateZ(80px);
        /* Adjust for new cube size */
    }

    .cube-front {
        transform: rotateY(0deg) translateZ(80px);
    }

    .cube-back {
        transform: rotateY(180deg) translateZ(80px);
    }

    .cube-right {
        transform: rotateY(90deg) translateZ(80px);
    }

    .cube-left {
        transform: rotateY(-90deg) translateZ(80px);
    }

    .cube-top {
        transform: rotateX(90deg) translateZ(80px);
    }

    .cube-bottom {
        transform: rotateX(-90deg) translateZ(80px);
    }

    .floating-elements {
        width: 280px;
        height: 280px;
    }

    @keyframes orbit {
        0% {
            transform: rotate(0deg) translateX(100px) rotate(0deg);
        }

        25% {
            transform: rotate(90deg) translateX(100px) rotate(-90deg);
        }

        50% {
            transform: rotate(180deg) translateX(100px) rotate(-180deg);
        }

        75% {
            transform: rotate(270deg) translateX(100px) rotate(-270deg);
        }

        100% {
            transform: rotate(360deg) translateX(100px) rotate(-360deg);
        }
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 15px;
    }

    .logo {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-role {
        font-size: 1.2rem;
        min-height: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .profile-section {
        width: 220px;
        height: 220px;
    }

    .abstract-hero-visual {
        width: 120px;
        height: 120px;
    }

    .cube-face {
        width: 120px;
        height: 120px;
        font-size: 2rem;
        transform: translateZ(60px);
        /* Adjust for new cube size */
    }

    .cube-front {
        transform: rotateY(0deg) translateZ(60px);
    }

    .cube-back {
        transform: rotateY(180deg) translateZ(60px);
    }

    .cube-right {
        transform: rotateY(90deg) translateZ(60px);
    }

    .cube-left {
        transform: rotateY(-90deg) translateZ(60px);
    }

    .cube-top {
        transform: rotateX(90deg) translateZ(60px);
    }

    .cube-bottom {
        transform: rotateX(-90deg) translateZ(60px);
    }

    .floating-elements {
        width: 220px;
        height: 220px;
    }

    .floating-element {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    @keyframes orbit {
        0% {
            transform: rotate(0deg) translateX(75px) rotate(0deg);
        }

        25% {
            transform: rotate(90deg) translateX(75px) rotate(-90deg);
        }

        50% {
            transform: rotate(180deg) translateX(75px) rotate(-180deg);
        }

        75% {
            transform: rotate(270deg) translateX(75px) rotate(-270deg);
        }

        100% {
            transform: rotate(360deg) translateX(75px) rotate(-360deg);
        }
    }

    .tech-tag {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    h2 {
        font-size: 1.8rem;
    }

    .contact-form {
        padding: 20px;
    }
}


/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--accent-color), var(--secondary-accent));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--secondary-accent), var(--accent-color));
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loader {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(0, 255, 213, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* Mobile Navigation Background Fix */
@media (max-width: 768px) {
    .mobile-nav {
        /* This adds a deep dark background */
        background-color: rgba(10, 15, 30, 0.98);

        /* This adds the blur effect (Glassmorphism) */
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);

        /* Ensures it covers the full side menu */
        width: 280px;
        /* Adjust width as needed */
        height: 100vh;
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden by default */
        display: flex;
        flex-direction: column;
        padding: 80px 20px;
        transition: 0.4s ease-in-out;
        z-index: 999;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* When the menu is open */
    .mobile-nav.active {
        right: 0;
    }

    /* Styling the links inside the mobile menu */
    .mobile-nav .nav-links {
        display: flex;
        flex-direction: column;
        gap: 25px;
        width: 100%;
    }

    .mobile-nav .nav-links li a {
        font-size: 1.1rem;
        color: #ffffff;
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* Fix for Arabic (RTL) Mobile Menu */
    html[dir="rtl"] .mobile-nav {
        right: auto;
        left: -100%;
        border-left: none;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    html[dir="rtl"] .mobile-nav.active {
        left: 0;
    }
}