/**
 * Tabeius Coming Soon - Main Stylesheet
 * Mobile-first, bilingual (EN/AR with RTL), accessible design
 * 
 * COLOR PALETTE (customize here):
 * --primary: #4F46E5 (Indigo)
 * --accent: #22C55E (Green)
 * --dark: #0F172A (Slate)
 * --light: #F8FAFC (Off-white)
 */

/* ===========================
   CSS CUSTOM PROPERTIES
   =========================== */
:root {
    /* Colors - EDIT THESE TO CHANGE THEME */
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #4338CA;
    --accent: #22C55E;
    --accent-light: #4ADE80;
    --dark: #0F172A;
    --dark-light: #1E293B;
    --light: #F8FAFC;
    --light-dark: #E2E8F0;
    --white: #FFFFFF;
    --error: #EF4444;
    --success: #10B981;
    
    /* Gradients */
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-overlay: linear-gradient(135deg, rgba(79, 70, 229, 0.9) 0%, rgba(99, 102, 241, 0.8) 100%);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-arabic: 'Tajawal', 'Arial', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(79, 70, 229, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 400ms ease-in-out;
    
    /* Z-index layers */
    --z-base: 1;
    --z-header: 100;
    --z-modal: 1000;
    --z-toast: 2000;
}

/* Arabic-specific variables */
[dir="rtl"] {
    --font-sans: var(--font-arabic);
}

/* ===========================
   RESET & BASE STYLES
   =========================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--light);
    background: var(--dark);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Background with gradient and image */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../img/bg.jpg') center/cover no-repeat;
    opacity: 0.15;
    z-index: -1;
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.brand-name {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--white), var(--light-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.headline {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    color: var(--white);
    margin-bottom: var(--spacing-md);
}

.subhead {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--light-dark);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.7;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===========================
   HEADER & NAVIGATION
   =========================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    padding: var(--spacing-md) var(--spacing-sm);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--light-dark);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lang-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lang-btn[aria-pressed="true"] {
    color: var(--white);
    background: var(--primary);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

/* ===========================
   MAIN CONTENT & HERO
   =========================== */
.main-content {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--spacing-2xl) + 60px) var(--spacing-md) var(--spacing-2xl);
}

.hero-section {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

/* Logo */
.logo-container {
    margin-bottom: var(--spacing-lg);
}

.logo {
    width: 250px;
    height: 150px;
    filter: drop-shadow(var(--shadow-lg));
    animation: float 6s ease-in-out infinite;
}

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

/* ===========================
   COUNTDOWN TIMER
   =========================== */
.countdown {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

/* Toggle countdown visibility - set display: none to hide */
.countdown {
    display: flex; /* Change to 'none' to disable countdown */
}

.countdown-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    min-width: 100px;
    box-shadow: var(--shadow-lg);
}

.countdown-value {
    display: block;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.countdown-label {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--light-dark);
    font-weight: 500;
}

/* ===========================
   NEWSLETTER FORM
   =========================== */
.form-container {
    max-width: 500px;
    margin: 0 auto;
}

.notify-form {
    width: 100%;
}

.form-group {
    position: relative;
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.email-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--dark);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.email-input::placeholder {
    color: rgba(15, 23, 42, 0.5);
}

.email-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.email-input:invalid:not(:placeholder-shown) {
    border-color: var(--error);
}

/* Honeypot - hidden from users */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.submit-btn {
    padding: 1rem 2rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.submit-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.submit-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error message */
.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: var(--spacing-xs);
    min-height: 1.25rem;
    text-align: center;
}

.privacy-note {
    font-size: 0.875rem;
    color: var(--light-dark);
    text-align: center;
    margin-top: var(--spacing-sm);
}

/* ===========================
   TOAST NOTIFICATION
   =========================== */
.toast {
    position: fixed;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    background: rgba(15, 23, 42, 0.95);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: var(--z-toast);
    transition: transform var(--transition-slow);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* ===========================
   SUCCESS MODAL
   =========================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--white);
    color: var(--dark);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: modalSlideIn var(--transition-slow);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: var(--white);
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
}

.modal-title {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: var(--spacing-sm);
}

.modal-text {
    color: var(--dark-light);
    margin-bottom: var(--spacing-lg);
}

.modal-close-btn {
    padding: 0.75rem 2rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    width: 100%;
}

.modal-close-btn:hover {
    background: var(--primary-light);
}

.modal-close-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===========================
   BACK TO TOP BUTTON
   =========================== */
.back-to-top {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    z-index: var(--z-header);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top:not([hidden]) {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* RTL adjustment */
[dir="rtl"] .back-to-top {
    left: var(--spacing-lg);
    right: auto;
}

/* ===========================
   FOOTER
   =========================== */
.footer {
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.copyright {
    font-size: 0.875rem;
    color: var(--light-dark);
}

/* ===========================
   ANIMATIONS
   =========================== */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.fade-in-delay-1 {
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.fade-in-delay-2 {
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.fade-in-delay-3 {
    animation: fadeIn 0.8s ease-out 0.6s both;
}

.fade-in-delay-4 {
    animation: fadeIn 0.8s ease-out 0.8s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Mobile devices (portrait) */
@media (max-width: 480px) {
    .form-group {
        flex-direction: column;
    }
    
    .countdown {
        gap: var(--spacing-sm);
    }
    
    .countdown-item {
        min-width: 80px;
        padding: var(--spacing-sm);
    }
    
    .back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    [dir="rtl"] .back-to-top {
        left: var(--spacing-md);
    }
}

/* Tablets */
@media (min-width: 768px) {
    .main-content {
        padding: calc(var(--spacing-2xl) + 80px) var(--spacing-lg) var(--spacing-2xl);
    }
    
    .countdown-item {
        min-width: 120px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .hero-section {
        max-width: 900px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .email-input,
    .submit-btn,
    .lang-switcher {
        border-width: 2px;
    }
}

/* Dark mode support (already dark by default) */
@media (prefers-color-scheme: light) {
    /* If you want to add light mode support, add overrides here */
}

/* Print styles */
@media print {
    .header,
    .footer,
    .back-to-top,
    .toast,
    .modal {
        display: none !important;
    }
    
    body::before,
    body::after {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}