/* ========================================
   Reset & Box Sizing
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   HTML & Body
   ======================================== */
html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-relaxed);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    direction: rtl;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Base Elements
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

/* ========================================
   Typography
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-xl);
}

h4 {
    font-size: var(--text-lg);
}

p {
    color: var(--text-secondary);
}

/* ========================================
   Container
   ======================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ========================================
   Cyber Text Effects
   ======================================== */
.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow-blue {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px rgba(0, 240, 255, 0.5);
}

.text-glow-pink {
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink), 0 0 20px rgba(255, 0, 255, 0.5);
}

.text-glow-purple {
    color: var(--neon-purple);
    text-shadow: 0 0 10px var(--neon-purple), 0 0 20px rgba(180, 0, 255, 0.5);
}

/* ========================================
   Glitch Effect
   ======================================== */
.glitch {
    position: relative;
    animation: glitchText 3s infinite;
}

@keyframes glitchText {
    0%, 90%, 100% {
        text-shadow: none;
    }
    91% {
        text-shadow: -2px 0 var(--neon-blue), 2px 0 var(--neon-pink);
    }
    92% {
        text-shadow: 2px 0 var(--neon-blue), -2px 0 var(--neon-pink);
    }
    93% {
        text-shadow: -1px 0 var(--neon-pink), 1px 0 var(--neon-blue);
    }
}

/* ========================================
   Section Header
   ======================================== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header h2 {
    margin-bottom: var(--space-md);
    font-size: var(--text-3xl);
}

.section-header p {
    font-size: var(--text-lg);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Cyber Background Elements
   ======================================== */

/* Scanner Line */
.scanner-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--neon-blue), 
        var(--neon-pink), 
        transparent
    );
    z-index: var(--z-scanner);
    animation: scan var(--duration-scan) linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes scan {
    0% {
        top: 0;
    }
    100% {
        top: 100%;
    }
}

/* Cyber Grid */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: var(--z-behind);
    pointer-events: none;
}

/* Glowing Orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: var(--z-behind);
    pointer-events: none;
    animation: orbFloat var(--duration-orb) ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.2), transparent 70%);
    top: -150px;
    right: -150px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 0, 255, 0.15), transparent 70%);
    bottom: -200px;
    left: -200px;
    animation-delay: -4s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(180, 0, 255, 0.15), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -2s;
}

@keyframes orbFloat {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.orb-3 {
    animation-name: orbFloatCenter;
}

@keyframes orbFloatCenter {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Corner Decorations */
.corner {
    position: fixed;
    width: 80px;
    height: 80px;
    z-index: var(--z-base);
    pointer-events: none;
}

.corner-tl {
    top: 20px;
    left: 20px;
    border-top: 2px solid var(--neon-blue);
    border-left: 2px solid var(--neon-blue);
    box-shadow: inset 5px 5px 10px rgba(0, 240, 255, 0.1);
}

.corner-tr {
    top: 20px;
    right: 20px;
    border-top: 2px solid var(--neon-pink);
    border-right: 2px solid var(--neon-pink);
    box-shadow: inset -5px 5px 10px rgba(255, 0, 255, 0.1);
}

.corner-bl {
    bottom: 20px;
    left: 20px;
    border-bottom: 2px solid var(--neon-pink);
    border-left: 2px solid var(--neon-pink);
    box-shadow: inset 5px -5px 10px rgba(255, 0, 255, 0.1);
}

.corner-br {
    bottom: 20px;
    right: 20px;
    border-bottom: 2px solid var(--neon-blue);
    border-right: 2px solid var(--neon-blue);
    box-shadow: inset -5px -5px 10px rgba(0, 240, 255, 0.1);
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-behind);
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-blue);
    border-radius: 50%;
    bottom: -10px;
    animation: particleRise var(--duration-particle) linear infinite;
}

.particle:nth-child(odd) {
    background: var(--neon-pink);
    width: 3px;
    height: 3px;
}

.particle:nth-child(3n) {
    background: var(--neon-purple);
    width: 5px;
    height: 5px;
}

.particle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: 50%;
    filter: blur(4px);
}

@keyframes particleRise {
    0% {
        bottom: -10px;
        opacity: 0;
        transform: translateX(0) scale(0);
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 100vh;
        opacity: 0;
        transform: translateX(100px) scale(0.5);
    }
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-weight: var(--font-medium);
    font-size: var(--text-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-outline {
    background: transparent;
    color: var(--neon-blue);
    border: 1px solid var(--neon-blue);
}

.btn-outline:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: var(--glow-blue);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--bg-primary);
    border: none;
    font-weight: var(--font-semibold);
}

.btn-primary:hover {
    box-shadow: var(--glow-blue-strong);
    transform: translateY(-2px);
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-pink);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) var(--bg-secondary);
}

/* ========================================
   Selection
   ======================================== */
::selection {
    background-color: var(--neon-pink);
    color: var(--bg-primary);
}

::-moz-selection {
    background-color: var(--neon-pink);
    color: var(--bg-primary);
}

/* ========================================
   Focus Styles
   ======================================== */
:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
}

/* ========================================
   Back to Top Button
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: var(--neon-blue);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: var(--z-fixed);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: var(--glow-blue);
    transform: translateY(-3px);
}

.back-to-top:hover i {
    animation: bounceUp 0.5s ease infinite;
}

@keyframes bounceUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}