:root {
    --deep-black: #0a0a0a;
    --gunmetal-gray: #1a1d21;
    --toxic-purple: #9b59b6;
    --acid-blue: #18b6f6;
    --radiation-teal: #00c9a7;
    --smoke-white: #e6e6e6;
    --pulse-red: #ff3b3b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--deep-black);
    color: var(--smoke-white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--deep-black);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-logo {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.logo-inner {
    scale: 7%;
    
    animation: pulse 2s infinite alternate;
    text-shadow: 0 0 30px rgba(155, 89, 182, 0.8);
    transform: translateZ(20px);
    color: var(--toxic-purple);
}

.loading-logo:hover {
    transform: perspective(500px) rotateY(15deg) rotateX(10deg) scale(1.1);
}

.loading-logo:hover .logo-inner {
    animation: warp 0.8s ease-in-out infinite alternate;
    color: var(--acid-blue);
}

.loading-progress {
    position: absolute;
    bottom: -40px;
    width: 220px;
    height: 4px;
    background: rgba(230, 230, 230, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--toxic-purple), var(--acid-blue));
    transition: width 0.5s ease;
}

@keyframes pulse {
    0% { transform: translateZ(20px) scale(1); }
    100% { transform: translateZ(20px) scale(1.1); }
}

@keyframes warp {
    0% { transform: translateZ(20px) rotate(0deg); }
    25% { transform: translateZ(20px) rotate(3deg) skewX(5deg); }
    50% { transform: translateZ(20px) rotate(0deg); }
    75% { transform: translateZ(20px) rotate(-3deg) skewX(-5deg); }
    100% { transform: translateZ(20px) rotate(0deg); }
}

/* Main Content */
#content {
    opacity: 0;
    transition: opacity 1s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
#hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-content {
    text-align: center;
    z-index: 10;
    position: relative;
}

.hero-title {
    font-size: 8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 10px;
    margin-bottom: 1rem;
    font-family: 'Raleway', sans-serif;
    text-shadow: 0 0 30px rgba(155, 89, 182, 0.7);
    background: linear-gradient(to right, var(--toxic-purple), var(--acid-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    letter-spacing: 4px;
    margin-bottom: 2rem;
    text-transform: uppercase;
    color: var(--smoke-white);
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
}

.scroll-text {
    margin-bottom: 10px;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--acid-blue);
}

.scroll-icon {
    width: 30px;
    height: 50px;
    border: 2px solid var(--toxic-purple);
    border-radius: 50px;
    position: relative;
}

.scroll-icon::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 10px;
    background-color: var(--toxic-purple);
    border-radius: 10px;
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { top: 10px; opacity: 1; }
    100% { top: 30px; opacity: 0; }
}

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    transition: all 0.4s ease;
}

#navbar.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--toxic-purple);
    text-decoration: none;
    font-family: 'Raleway', sans-serif;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.logo:hover {
    color: var(--acid-blue);
    text-shadow: 0 0 15px rgba(24, 182, 246, 0.7);
}

.nav-links {
    margin: 1%;
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: var(--smoke-white);
    text-decoration: none;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--radiation-teal);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--toxic-purple), var(--acid-blue));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.language-switcher {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.language-btn {
    background: rgba(26, 29, 33, 0.7);
    border: 1px solid rgba(155, 89, 182, 0.3);
    color: var(--smoke-white);
    border-radius: 4px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.language-btn:hover {
    background: var(--toxic-purple);
    transform: translateY(-2px);
}

.language-btn.active {
    background: var(--toxic-purple);
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.5);
}

/* Sections */
.section {
    padding: 100px 0;
    position: relative;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 80px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Raleway', sans-serif;
    color: var(--smoke-white);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--toxic-purple), var(--acid-blue));
}

/* About */
.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-text {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--smoke-white);
}

.about-text strong {
    color: var(--radiation-teal);
}

.about-image {
    flex: 1;
    position: relative;
    height: 500px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    z-index: 1;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.05);
}

/* Skills */
#skills {
    background-color: var(--gunmetal-gray);
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.skill-name {
    width: 200px;
    font-weight: 600;
    color: var(--smoke-white);
}

.skill-bar {
    flex: 1;
    height: 20px;
    background: rgba(26, 29, 33, 0.7);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.skill-level {
    height: 100%;
    width: 0;
    background: linear-gradient(to right, var(--toxic-purple), var(--acid-blue));
    border-radius: 10px;
    position: relative;
}

.skill-value {
    position: absolute;
    right: 10px;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--smoke-white);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}

/* Portfolio - Updated with video styles */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.portfolio-item {
    position: relative;
    height: 350px;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid rgba(155, 89, 182, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
    transform-style: preserve-3d;
}

.portfolio-item:hover {
    transform: translateY(-10px) rotateY(5deg) rotateX(3deg);
    box-shadow: 0 15px 35px rgba(155, 89, 182, 0.4);
}

.portfolio-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
    z-index: 1;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 20px;
    text-align: center;
    z-index: 2;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--acid-blue);
    text-shadow: 0 0 10px rgba(24, 182, 246, 0.5);
}

.portfolio-category {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    color: var(--radiation-teal);
}

.portfolio-item p {
    color: var(--smoke-white);
    max-width: 90%;
}

/* Play Button - Preserving your changes */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.play-icon i {
    color: white;
    font-size: 30px;
    margin-left: 5px;
}

.portfolio-item:hover .play-icon {
    opacity: 0.0;
}

/* Video state indicator */
.video-playing {
    opacity: 1;
}

/* Contact */
#contact {
    background-color: var(--gunmetal-gray);
    position: relative;
}

.contact-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-info {
    max-width: 600px;
    margin: 0 auto;
}

.contact-detail {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    justify-content: center;
}

.contact-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--toxic-purple), var(--acid-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    font-size: 1.5rem;
}

.contact-text {
    font-size: 1.1rem;
    color: var(--smoke-white);
}

.contact-text a {
    color: var(--radiation-teal);
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-text a:hover {
    color: var(--acid-blue);
    text-shadow: 0 0 10px rgba(24, 182, 246, 0.5);
}

.social-links {
    display: flex;
    margin-top: 40px;
    gap: 20px;
    justify-content: center;
}

.social-link {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--deep-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--smoke-white);
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.social-link:hover {
    background: linear-gradient(135deg, var(--toxic-purple), var(--acid-blue));
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
    border-color: transparent;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--toxic-purple), var(--acid-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--smoke-white);
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(155, 89, 182, 0.5);
}

/* Footer */
#footer {
    padding: 40px 0;
    text-align: center;
    background: var(--deep-black);
    border-top: 1px solid rgba(155, 89, 182, 0.1);
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--smoke-white);
}

/* Media Queries */
@media (max-width: 992px) {
    .hero-title {
        font-size: 5rem;
    }
    
    .about-content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .nav-links {
        /* display: none; */
    }
    .nav-link {
        display: none;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-item {
        height: 300px;
    }
    
    .loading-logo {
        width: 150px;
        height: 150px;
    }
    
    .logo-inner {
        font-size: 6rem;
    }
    
    .skill-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .skill-bar {
        width: 100%;
    }
}

/* Matrix language transition effect */
.matrix-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
}

.matrix-text {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--radiation-teal);
    text-align: center;
    max-width: 800px;
    padding: 20px;
}

.matrix-char {
    opacity: 0;
    transition: opacity 0.1s ease;
}

/* Arabic language support */
.rtl {
    direction: rtl;
    text-align: right;
}
.mb{
    margin-bottom: 4%;
    margin-top: 4%;
}

.about-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    z-index: 0; /* Ensure it's behind content */
}

/* Remove portfolio-video styles from about video */
.about-image .portfolio-video {
    all: unset;
}