html {
    scroll-behavior: smooth;
}

body {
    font-family: "Aria", sans-serif;
    background: #0a0a0f;
}

/* RTL-aware Scroll Reveal Animations - animations now come from right in RTL */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* In RTL, reveal-left now slides from right */
.reveal-left {
    opacity: 0;
    transform: translateX(80px);
    transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

/* In RTL, reveal-right now slides from left */
.reveal-right {
    opacity: 0;
    transform: translateX(-80px);
    transition: all 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger > *:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger > *:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger > *:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger > *:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger > *:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger > *:nth-child(6) {
    transition-delay: 0.6s;
}

/* Hero Background */
.hero-bg {
    background: radial-gradient(
            ellipse 100% 70% at 50% 0%,
            rgba(0, 212, 255, 0.08) 0%,
            transparent 50%
    ),
    radial-gradient(
            ellipse 80% 50% at 20% 50%,
            rgba(255, 107, 53, 0.05) 0%,
            transparent 40%
    ),
    linear-gradient(180deg, #0a0a0f 0%, #0f0f1a 50%, #1a1a2e 100%);
}

/* Enhanced Grid Pattern with circuit-like lines for industrial feel */
.grid-pattern {
    background-image: linear-gradient(
            rgba(0, 212, 255, 0.03) 1px,
            transparent 1px
    ),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Circuit pattern overlay for tech/industrial theme */
.circuit-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50h40v-20h20v40h-20v-20h-40' fill='none' stroke='rgba(0,212,255,0.05)' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='3' fill='rgba(0,212,255,0.08)'/%3E%3Ccircle cx='40' cy='30' r='2' fill='rgba(0,212,255,0.06)'/%3E%3Ccircle cx='60' cy='70' r='2' fill='rgba(0,212,255,0.06)'/%3E%3C/svg%3E");
    background-size: 100px 100px;
}

/* Added code pattern overlay for web dev sections */
.code-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ctext x='5' y='15' font-family='Aria' font-size='8' fill='rgba(16,185,129,0.06)'%3E%3C/text%3E%3Ctext x='25' y='30' font-family='Aria' font-size='8' fill='rgba(0,212,255,0.06)'%3E{ }%3C/text%3E%3Ctext x='10' y='45' font-family='Aria' font-size='8' fill='rgba(16,185,129,0.06)'%3E()%3C/text%3E%3C/svg%3E");
    background-size: 60px 60px;
}

/* Glassmorphism Card */
.glass-card {
    background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 100%
    );
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card:hover {
    background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.03) 100%
    );
    border-color: rgba(0, 212, 255, 0.3);
}

/* Added web dev card variant with green accent */
.glass-card-dev:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.15);
}

/* Glow Effects */
.glow-accent {
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.2),
    0 0 100px rgba(0, 212, 255, 0.1);
}

.text-glow {
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
}

/* Added green text glow for web dev */
.text-glow-green {
    text-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(
            135deg,
            #00d4ff 0%,
            #0099cc 50%,
            #00d4ff 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-orange {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Added green gradient text for web dev sections */
.gradient-text-green {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Button Micro-interactions */
.btn-primary {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4),
    0 0 60px rgba(0, 212, 255, 0.2);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* RTL-aware button shine animation */
.btn-primary::before {
    content: "";
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            270deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent
    );
    transition: right 0.5s ease;
}

.btn-primary:hover::before {
    right: 100%;
}

.btn-outline {
    border: 2px solid rgba(0, 212, 255, 0.5);
    transition: all 0.4s ease;
}

.btn-outline:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

/* Card Hover Effects */
.project-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(0, 212, 255, 0.15);
}

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

.project-card:hover .project-tech {
    transform: translateY(0);
    opacity: 1;
}

/* Floating Animations */
@keyframes float {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

@keyframes float-slow {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-30px);
    }
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.6);
    }
}

@keyframes data-stream {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* Added gear rotation animation for industrial theme */
@keyframes gear-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes gear-rotate-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Added typing cursor animation for code elements */
@keyframes typing-cursor {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.typing-cursor::after {
    content: "|";
    animation: typing-cursor 1s infinite;
    color: #10b981;
}

.float {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: float-slow 8s ease-in-out infinite;
}

.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

.gear-rotate {
    animation: gear-rotate 20s linear infinite;
}

.gear-rotate-reverse {
    animation: gear-rotate-reverse 15s linear infinite;
}

/* Tech Stack Animation */
@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(120px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(120px) rotate(-360deg);
    }
}

.orbit-1 {
    animation: orbit 15s linear infinite;
}

.orbit-2 {
    animation: orbit 20s linear infinite reverse;
}

.orbit-3 {
    animation: orbit 25s linear infinite;
}

/* RTL-aware Timeline - line position adjusted */
.timeline-line {
    background: linear-gradient(
            180deg,
            transparent 0%,
            #00d4ff 10%,
            #00d4ff 90%,
            transparent 100%
    );
}

/* Nav styling */
.nav-scrolled {
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* RTL-aware nav link underline animation */
.nav-link::after {
    content: "";
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 0;
    height: 2px;
    background: #00d4ff;
    transition: width 0.3s ease;
}

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

/* HUD Style Elements */
.hud-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: rgba(0, 212, 255, 0.5);
}

.hud-corner-tl {
    top: 0;
    right: 0;
    border-top: 2px solid;
    border-right: 2px solid;
}

.hud-corner-tr {
    top: 0;
    left: 0;
    border-top: 2px solid;
    border-left: 2px solid;
}

.hud-corner-bl {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid;
    border-right: 2px solid;
}

.hud-corner-br {
    bottom: 0;
    left: 0;
    border-bottom: 2px solid;
    border-left: 2px solid;
}

/* Industrial gear SVG decoration */
.industrial-gear {
    position: absolute;
    opacity: 0.05;
}

/* Server rack decoration for tech theme */
.server-lights {
    display: flex;
    gap: 4px;
}

.server-light {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: blink 2s infinite;
}

.server-light:nth-child(2) {
    animation-delay: 0.3s;
}

.server-light:nth-child(3) {
    animation-delay: 0.6s;
}

.server-light:nth-child(4) {
    animation-delay: 0.9s;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Added code editor styling for web dev visual elements */
.code-editor {
    background: linear-gradient(
            135deg,
            rgba(16, 185, 129, 0.05) 0%,
            rgba(0, 212, 255, 0.03) 100%
    );
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-family: "JetBrains Mono", monospace;
}

.code-line-number {
    color: rgba(255, 255, 255, 0.3);
    user-select: none;
}

.code-keyword {
    color: #c792ea;
}

.code-function {
    color: #82aaff;
}

.code-string {
    color: #c3e88d;
}

.code-comment {
    color: #546e7a;
}

.code-variable {
    color: #f78c6c;
}

/* Loader */
.loader {
    position: fixed;
    inset: 0;
    background: #0a0a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-ring {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 212, 255, 0.1);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
    background: #1a1a2e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00d4ff;
}

/* RTL-aware arrow icons - flip horizontally */
.rtl-flip {
    transform: scaleX(-1);
}

/* Team card styles */
.team-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.team-card:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(0, 212, 255, 0.1);
}

/* FAQ Styles */
.faq-trigger {
    position: relative;
    cursor: pointer;
    border: none;
    background: none;
    color: white; /* Default text color */
    text-align: right; /* For RTL */
    width: 100%;
    padding-right: 32px; /* Adjust for RTL alignment */
    padding-left: 32px; /* Standard padding */
}

.faq-trigger:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.faq-trigger .faq-icon {
    transform: rotate(0deg); /* Default state */
}

.faq-trigger.active .faq-icon {
    transform: rotate(180deg); /* Rotated when active */
}

.faq-content {
    box-sizing: border-box; /* Include padding in max-height calculation */
}

.faq-content.open {
    /* max-height is set via JS to reveal content */
}