/* =========================================
   1. Variables & Reset
   ========================================= */
:root {
    --primary-color: #00f2ff; /* Cyan Neon */
    --secondary-color: #7000ff; /* Purple Neon */
    --bg-dark: #0a0e17; /* Deep Navy/Black */
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --font-main: 'Cairo', sans-serif;
    --transition: all 0.3s ease-in-out;
    --glow-shadow: 0 0 10px rgba(0, 242, 255, 0.5), 0 0 20px rgba(0, 242, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    direction: rtl;
    overflow-x: hidden;
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* Scrollbar Customization */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--secondary-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* =========================================
   2. Utility Classes & Layout
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding { padding: 100px 0; }

.text-center { text-align: center; }

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    z-index: 1;
    cursor: pointer;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn:hover {
    color: var(--bg-dark);
    background: var(--primary-color);
    box-shadow: var(--glow-shadow);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 10px auto 0;
    border-radius: 2px;
}

/* =========================================
   3. Header & Navigation
   ========================================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    padding: 20px 0;
}

header.scrolled {
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 1px;
}

.logo span { color: var(--primary-color); }

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    position: relative;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::before, .nav-links a.active::before { width: 100%; }

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* =========================================
   4. Hero Section & Particles
   ========================================= */
#hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, #1a2236 0%, var(--bg-dark) 100%);
    overflow: hidden;
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content span {
    color: transparent;
    -webkit-text-stroke: 1px var(--primary-color);
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* =========================================
   5. Components (Cards, Services, Portfolio)
   ========================================= */
.glass-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 30px;
    border-radius: 15px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.glass-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    transform: rotate(45deg);
    opacity: 0;
    transition: var(--transition);
}

.glass-card:hover::before { opacity: 1; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.stat-item h3 { font-size: 3rem; color: var(--primary-color); }
.stat-item p { color: var(--text-muted); }

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-icon {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tech-stack span {
    display: inline-block;
    font-size: 0.8rem;
    padding: 5px 10px;
    background: rgba(112, 0, 255, 0.2);
    border-radius: 20px;
    margin: 5px 0 0 5px;
    color: var(--primary-color);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

/* Contact Form */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.form-group { margin-bottom: 20px; position: relative; }

.form-control {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 8px;
    font-family: var(--font-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

/* =========================================
   6. Footer
   ========================================= */
footer {
    background: #05070c;
    padding: 50px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.social-links a {
    font-size: 1.5rem;
    margin-left: 15px;
    color: var(--text-muted);
}
.social-links a:hover { color: var(--primary-color); }

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =========================================
   7. Loader
   ========================================= */
#loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.spinner {
    width: 50px; height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* =========================================
   8. Animation Classes (JS Triggered)
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   9. Media Queries
   ========================================= */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 70px;
        right: 0;
        width: 100%;
        background: var(--bg-dark);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        transform: translateY(-150%);
        transition: var(--transition);
        border-bottom: 1px solid var(--primary-color);
    }
    .nav-links.nav-active { transform: translateY(0); }
    .mobile-toggle { display: block; }
    .hero-content h1 { font-size: 2.2rem; }
    .contact-wrapper { grid-template-columns: 1fr; }
}