/* ==========================================================================
   Design System & Variable Declarations
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-deep: #06040d;
    --bg-secondary: #0d0a1b;
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(6, 182, 212, 0.4);

    --purple-glow: #a855f7;
    --purple-light: #c084fc;
    --cyan-glow: #06b6d4;
    --cyan-light: #22d3ee;
    --pink-glow: #ec4899;
    --gold-glow: #f59e0b;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;

    /* Fonts */
    --font-ar: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-en: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    font-family: var(--font-ar);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   Background Space Effects
   ========================================================================== */
/* Stars layer */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration, 4s) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: var(--max-opacity, 0.8); transform: scale(1.1); }
}

/* Ambient Nebulae */
.nebula {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(140px);
    opacity: 0.4;
    mix-blend-mode: screen;
    animation: float-nebula 25s infinite alternate ease-in-out;
}

.nebula-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(168,85,247,0.4) 0%, rgba(99,102,241,0.05) 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.nebula-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6,182,212,0.3) 0%, rgba(59,130,246,0.05) 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -5s;
}

.nebula-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(236,72,153,0.2) 0%, transparent 80%);
    top: 40%;
    right: 25%;
    animation-delay: -10s;
}

@keyframes float-nebula {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.15); }
}

/* ==========================================================================
   App Container & Layout
   ========================================================================== */
.app-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    z-index: 10;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

/* ==========================================================================
   Header Component
   ========================================================================== */
.header {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
}

.logo-icon {
    width: 45px;
    height: 45px;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
}

.logo-orbit {
    transform-origin: center;
    animation: rotate-clockwise 15s linear infinite;
}

.logo-orbit-inner {
    transform-origin: center;
    animation: rotate-counter-clockwise 8s linear infinite;
}

.logo-planet-1 {
    transform-origin: center;
    animation: rotate-clockwise 5s linear infinite;
}

.logo-planet-2 {
    transform-origin: center;
    animation: rotate-counter-clockwise 3s linear infinite;
}

.logo-core {
    animation: pulse-core 2s ease-in-out infinite alternate;
}

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

@keyframes rotate-counter-clockwise {
    to { transform: rotate(-360deg); }
}

@keyframes pulse-core {
    0% { r: 9px; filter: drop-shadow(0 0 2px rgba(168, 85, 247, 0.5)); }
    100% { r: 11px; filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.9)); }
}

.logo-text {
    font-family: var(--font-en);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--text-primary) 30%, #a8a29e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.accent-text {
    background: linear-gradient(135deg, var(--cyan-glow) 0%, var(--purple-glow) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.main-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Maintenance Badge */
.maintenance-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.2);
    padding: 6px 16px;
    border-radius: 100px;
    backdrop-filter: blur(6px);
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.1);
    animation: float-badge 4s infinite ease-in-out;
}

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

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--cyan-glow);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--cyan-glow);
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 16px;
    height: 16px;
    border: 1px solid var(--cyan-glow);
    border-radius: 50%;
    animation: badge-pulse 2s infinite ease-out;
    opacity: 0.8;
}

@keyframes badge-pulse {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.badge-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cyan-light);
    letter-spacing: 0.5px;
}

/* Main Text Titles */
.main-title {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.35;
    max-width: 750px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 40%, #cbd5e1 70%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.description strong {
    font-weight: 700;
    color: var(--cyan-light);
}

/* ==========================================================================
   Orbit Visualizer (Centerpiece)
   ========================================================================== */
.orbit-visualizer-container {
    height: 180px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    perspective: 800px;
}

.orbit-visualizer {
    position: relative;
    width: 300px;
    height: 300px;
    transform: rotateX(68deg) rotateY(-12deg);
    transform-style: preserve-3d;
}

.center-star {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0);
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, #ffffff 10%, var(--purple-glow) 70%, var(--purple-hover) 100%);
    border-radius: 50%;
    box-shadow: 0 0 35px var(--purple-glow), 0 0 70px rgba(168, 85, 247, 0.4);
    transform-style: preserve-3d;
}

.star-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: 50%;
    filter: blur(8px);
    animation: star-pulse 2s infinite alternate ease-in-out;
}

@keyframes star-pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.3); opacity: 1; }
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    transform-style: preserve-3d;
    transition: border-color var(--transition-fast);
}

.orbit:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.orbit-1 {
    width: 110px;
    height: 110px;
    animation: rotate-clockwise 10s linear infinite;
}

.orbit-2 {
    width: 190px;
    height: 190px;
    animation: rotate-counter-clockwise 18s linear infinite;
}

.orbit-3 {
    width: 270px;
    height: 270px;
    animation: rotate-clockwise 26s linear infinite;
}

.orbiting-body {
    position: absolute;
    border-radius: 50%;
    transform-style: preserve-3d;
}

.body-cyan {
    width: 10px;
    height: 10px;
    background-color: var(--cyan-glow);
    box-shadow: 0 0 12px var(--cyan-glow);
    top: 10%;
    left: 15%;
}

.body-purple {
    width: 14px;
    height: 14px;
    background-color: var(--purple-glow);
    box-shadow: 0 0 15px var(--purple-glow);
    top: 80%;
    left: 20%;
}

.body-pink {
    width: 12px;
    height: 12px;
    background-color: var(--pink-glow);
    box-shadow: 0 0 12px var(--pink-glow);
    top: 40%;
    right: 2%;
}

/* ==========================================================================
   Countdown Component
   ========================================================================== */
.countdown-container {
    width: 100%;
    max-width: 550px;
    margin-bottom: 1.5rem;
}

.countdown-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.countdown-item {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 14px 10px;
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.countdown-item::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-item:hover {
    transform: translateY(-5px);
    border-color: rgba(168, 85, 247, 0.25);
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.15);
}

.countdown-value {
    font-family: var(--font-en);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 6px;
    color: var(--text-primary);
    background: linear-gradient(to bottom, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.countdown-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==========================================================================
   Newsletter & Subscription Card
   ========================================================================== */
.newsletter-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.01) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 550px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: border-color var(--transition-smooth);
}

.newsletter-card:hover {
    border-color: rgba(6, 182, 212, 0.2);
}

.newsletter-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.newsletter-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.subscribe-form {
    width: 100%;
}

.input-wrapper {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 6px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-wrapper:focus-within {
    border-color: var(--border-glass-focus);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.subscribe-form input {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-ar);
    font-size: 0.95rem;
    padding: 10px 14px;
    width: 100%;
}

.subscribe-form input::placeholder {
    color: #475569;
}

.submit-btn {
    background: linear-gradient(135deg, var(--cyan-glow) 0%, var(--purple-glow) 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-family: var(--font-ar);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 22px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
    white-space: nowrap;
}

.submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

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

.btn-icon {
    transition: transform var(--transition-fast);
}

.submit-btn:hover .btn-icon {
    transform: translateX(-3px); /* Shift icon left due to RTL direction */
}

/* Feedback Message Styles */
.feedback-message {
    font-size: 0.85rem;
    margin-top: 10px;
    min-height: 20px;
    text-align: right;
    font-weight: 600;
    transition: opacity var(--transition-fast);
    opacity: 0;
}

.feedback-message.show {
    opacity: 1;
}

.feedback-message.success {
    color: #4ade80; /* Light emerald green */
}

.feedback-message.error {
    color: #f87171; /* Soft red */
}

/* Loading state for form */
.submit-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.submit-btn.loading .btn-text {
    opacity: 0.6;
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
.footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 2rem;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-link {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.social-link:hover {
    color: var(--cyan-light);
    border-color: rgba(6, 182, 212, 0.4);
    background: rgba(6, 182, 212, 0.05);
    transform: translateY(-3px);
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 640px) {
    .app-container {
        padding: 1.5rem 1rem;
    }

    .main-title {
        font-size: 1.85rem;
    }

    .description {
        font-size: 0.95rem;
        padding: 0 5px;
    }

    .orbit-visualizer-container {
        height: 140px;
    }

    .orbit-visualizer {
        width: 220px;
        height: 220px;
    }

    .orbit-1 { width: 80px; height: 80px; }
    .orbit-2 { width: 140px; height: 140px; }
    .orbit-3 { width: 200px; height: 200px; }

    .center-star {
        width: 24px;
        height: 24px;
    }

    .countdown {
        gap: 10px;
    }

    .countdown-item {
        padding: 10px 4px;
        border-radius: 12px;
    }

    .countdown-value {
        font-size: 1.6rem;
    }

    .countdown-label {
        font-size: 0.72rem;
    }

    .newsletter-card {
        padding: 1.25rem 1rem;
        border-radius: 20px;
    }

    .input-wrapper {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
        gap: 10px;
    }

    .input-wrapper:focus-within {
        box-shadow: none;
    }

    .subscribe-form input {
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid var(--border-glass);
        border-radius: 12px;
        padding: 12px 14px;
        text-align: center;
    }

    .subscribe-form input:focus {
        border-color: var(--border-glass-focus);
    }

    .submit-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        border-radius: 12px;
    }

    .submit-btn:hover .btn-icon {
        transform: none;
    }

    .feedback-message {
        text-align: center;
    }
}
