/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Colors */
    --bg-dark: #030712;
    --bg-darker: #010409;
    --bg-card: rgba(10, 20, 40, 0.45);
    
    --primary: #00f2fe;
    --primary-rgb: 0, 242, 254;
    --secondary: #7f00ff;
    --secondary-rgb: 127, 0, 255;
    --accent: #e100ff;
    
    --text-white: #f8fafc;
    --text-light: #e2e8f0;
    --text-muted: #94a3b8;
    
    --success: #00f5d4;
    --error: #ff3366;
    
    /* Layout & Glassmorphism */
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(0, 242, 254, 0.35);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    /* Fonts */
    --font-en: 'Outfit', sans-serif;
    --font-ar: 'Cairo', sans-serif;
}

/* Lang Custom Font Mappings */
body.lang-en {
    font-family: var(--font-en);
}
body.lang-ar {
    font-family: var(--font-ar);
}

/* ==========================================================================
   RESET & BASICS
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, border-color 0.3s, transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: var(--bg-dark);
    color: var(--text-white);
    scroll-behavior: smooth;
}

/* Smooth layout shift prevention */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-rgb), 0.6);
}

/* ==========================================================================
   INTERACTIVE CANVAS & BACKGROUND BLOBS
   ========================================================================== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: all;
    background: radial-gradient(circle at 50% 50%, #080f25 0%, var(--bg-dark) 80%);
}

.glow-blob {
    position: fixed;
    width: 45vw;
    height: 45vw;
    max-width: 600px;
    max-height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
    animation: blob-float 20s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes blob-float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(5%, 10%) scale(1.1) rotate(180deg);
    }
    100% {
        transform: translate(-5%, -5%) scale(0.9) rotate(360deg);
    }
}

/* ==========================================================================
   TOP BAR (HEADER)
   ========================================================================== */
.top-bar {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.tech-logo {
    width: 46px;
    height: 46px;
    filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.5));
}

.rot-circle {
    transform-origin: center;
    animation: spin 20s linear infinite;
}

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

.hex-path {
    animation: pulse-stroke 4s infinite alternate ease-in-out;
}

@keyframes pulse-stroke {
    0% { stroke-width: 2; opacity: 0.7; }
    100% { stroke-width: 3.5; opacity: 1; filter: drop-shadow(0 0 3px var(--primary)); }
}

.glow-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: draw-glow 6s infinite ease-in-out;
}

@keyframes draw-glow {
    0%, 100% { stroke-dashoffset: 40; }
    50% { stroke-dashoffset: 0; }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-white);
}

.logo-accent {
    background: linear-gradient(135deg, var(--primary) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Language Button */
.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.6rem 1.2rem;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.25);
    transform: translateY(-2px);
}

.globe-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.8s ease;
}

.lang-btn:hover .globe-icon {
    transform: rotate(180deg);
}

/* ==========================================================================
   MAIN LAYOUT & CONTAINERS
   ========================================================================== */
.content-container {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 1rem;
}

/* Glowing Launch Badge */
.badge {
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.25);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.1);
    animation: fade-in-down 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.lang-ar .badge {
    font-family: var(--font-ar);
    letter-spacing: 0;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary);
    animation: ping 1.8s infinite;
}

@keyframes ping {
    0% { transform: scale(0.9); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.4; }
    100% { transform: scale(0.9); opacity: 1; }
}

/* ==========================================================================
   HERO TEXT & TITLES
   ========================================================================== */
.hero-section {
    margin-bottom: 3rem;
    animation: fade-in-up 0.8s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.main-title {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

body.lang-ar .main-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.4;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(var(--primary-rgb), 0.15));
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 400;
}

body.lang-ar .subtitle {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* ==========================================================================
   COUNTDOWN TIMER
   ========================================================================== */
.countdown-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    width: 100%;
    max-width: 650px;
    margin-bottom: 3.5rem;
    animation: fade-in-up 0.8s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.countdown-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 1.5rem 1rem;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.countdown-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    pointer-events: none;
}

.countdown-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-5px);
}

.countdown-val {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(180deg, #ffffff 40%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 1.5px;
}

body.lang-ar .countdown-label {
    font-family: var(--font-ar);
    font-size: 0.85rem;
    letter-spacing: 0;
}

/* ==========================================================================
   NEWSLETTER SUBSCRIPTION CARD
   ========================================================================== */
.newsletter-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.45) 0%, rgba(30, 41, 59, 0.3) 100%);
    border: 1px solid var(--glass-border);
    padding: 3rem 2.5rem;
    border-radius: 24px;
    width: 100%;
    max-width: 700px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin-bottom: 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fade-in-up 0.8s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.newsletter-card::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.15) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
    pointer-events: none;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

body.lang-ar .card-title {
    font-size: 1.65rem;
    line-height: 1.4;
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Form Styles */
.subscribe-form {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
}

.input-wrapper {
    flex-grow: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.subscribe-form input {
    width: 100%;
    background: rgba(1, 4, 9, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.1rem 1.5rem;
    color: var(--text-white);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

/* Direction adjustments for inputs */
body.lang-ar .subscribe-form input {
    text-align: right;
    font-family: var(--font-ar);
}

.subscribe-form input:focus {
    border-color: rgba(var(--primary-rgb), 0.5);
    background: rgba(1, 4, 9, 0.85);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.15);
}

.focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.4s ease;
}

.subscribe-form input:focus ~ .focus-border {
    width: 100%;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #0099ff 100%);
    border: none;
    border-radius: 12px;
    padding: 1.1rem 2rem;
    color: #030712;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.3);
    position: relative;
    overflow: hidden;
}

body.lang-ar .submit-btn {
    font-family: var(--font-ar);
}

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

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(var(--primary-rgb), 0.45);
}

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

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

.btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* Adjust button arrow direction for RTL */
body.lang-ar .btn-arrow {
    transform: scaleX(-1);
}
body.lang-ar .submit-btn:hover .btn-arrow {
    transform: scaleX(-1) translateX(4px);
}

/* Form Message */
.form-message {
    font-size: 0.9rem;
    margin-top: 1rem;
    min-height: 1.5rem;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    font-weight: 500;
}

.form-message.show {
    opacity: 1;
    transform: translateY(0);
}

.form-message.success {
    color: var(--success);
    filter: drop-shadow(0 0 4px rgba(0, 245, 212, 0.3));
}

.form-message.error {
    color: var(--error);
    filter: drop-shadow(0 0 4px rgba(255, 51, 102, 0.3));
}

/* Spinner during loading */
.btn-spinner {
    animation: rotate-spinner 2s linear infinite;
    width: 20px;
    height: 20px;
}

.btn-spinner .path {
    stroke: #030712;
    stroke-linecap: round;
    animation: dash-spinner 1.5s ease-in-out infinite;
}

.hidden {
    display: none !important;
}

@keyframes rotate-spinner {
    100% { transform: rotate(360deg); }
}

@keyframes dash-spinner {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* ==========================================================================
   SERVICES GRID SECTION
   ========================================================================== */
.services-section {
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 2rem;
    animation: fade-in-up 0.8s 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

body.lang-ar .section-title {
    font-family: var(--font-ar);
    letter-spacing: 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.2rem 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--glass-shadow);
    position: relative;
    cursor: default;
}

.service-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.1);
    transform: translateY(-8px);
}

.service-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15) 0%, rgba(var(--secondary-rgb), 0.05) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    filter: drop-shadow(0 4px 10px rgba(var(--primary-rgb), 0.1));
    transition: all 0.3s ease;
}

.service-card:hover .service-icon-wrap {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #030712;
    transform: scale(1.1) rotate(5deg);
    border-color: transparent;
    filter: drop-shadow(0 0 15px rgba(var(--primary-rgb), 0.4));
}

.service-icon {
    width: 28px;
    height: 28px;
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-white);
}

body.lang-ar .service-card h3 {
    font-size: 1.1rem;
}

.service-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==========================================================================
   FOOTER SECTION
   ========================================================================== */
.footer {
    width: 100%;
    max-width: 1200px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    z-index: 10;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

.social-icon:hover {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.2);
}

.copyright {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

body.lang-ar .copyright {
    font-family: var(--font-ar);
}

/* ==========================================================================
   PAGE ENTRY ANIMATIONS
   ========================================================================== */
@keyframes fade-in-down {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVENESS (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 1.5rem;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .content-container {
        padding: 1.5rem;
        margin-top: 0;
    }
    
    .main-title {
        font-size: 2.3rem;
    }
    
    body.lang-ar .main-title {
        font-size: 2.1rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .countdown-container {
        gap: 0.75rem;
    }
    
    .countdown-card {
        padding: 1rem 0.5rem;
        border-radius: 14px;
    }
    
    .countdown-val {
        font-size: 2rem;
    }
    
    .countdown-label {
        font-size: 0.7rem;
    }
    
    .newsletter-card {
        padding: 2.2rem 1.5rem;
        border-radius: 18px;
    }
    
    .subscribe-form {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .submit-btn {
        width: 100%;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-title {
        font-size: 1.9rem;
    }
    
    body.lang-ar .main-title {
        font-size: 1.8rem;
    }
    
    .countdown-container {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .countdown-val {
        font-size: 1.5rem;
    }
    
    .countdown-label {
        font-size: 0.6rem;
    }
}
