:root {
    /* Dark Mode (Default) */
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #8b5cf6;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --mockup-received-bg: rgba(255,255,255,0.1);
    --mockup-received-text: #f8fafc;
}

body.light-mode {
    --bg-color: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #475569;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #7c3aed;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --mockup-received-bg: rgba(0,0,0,0.05);
    --mockup-received-text: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body[dir="rtl"] {
    font-family: 'Cairo', sans-serif;
}

body[dir="rtl"] * {
    font-family: 'Cairo', sans-serif;
}

body[dir="ltr"] {
    font-family: 'Outfit', sans-serif;
}

/* Background Animated Blobs */
.background-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 10s infinite ease-in-out alternate;
}

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

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

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Glassmorphism Classes */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: 600;
}

.icon-btn:hover {
    background: rgba(124, 58, 237, 0.2);
    color: var(--accent);
}

.icon-btn svg {
    transition: transform 0.3s ease;
}

.icon-btn:hover svg {
    transform: scale(1.1);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    flex: 1;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.download-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.version-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.text-sm {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.125rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

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

.download-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.5);
}

.download-btn:hover:not(.disabled)::before {
    left: 100%;
}

.download-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #334155;
    box-shadow: none;
}

/* Coming Soon & Register */
.coming-soon-container {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeInUp 1s ease;
}

.soon-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    color: white;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.glow-text {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGlow 2s infinite alternate;
}

@keyframes textGlow {
    from { filter: drop-shadow(0 0 5px rgba(255,255,255,0.1)); }
    to { filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.5)); }
}

.coming-soon-header p {
    margin-bottom: 2.5rem;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.register-form {
    max-width: 500px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.register-form input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}

.submit-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.form-msg {
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.form-msg.success { color: #22c55e; }
.form-msg.error { color: #ef4444; }

body.light-mode .input-group {
    background: rgba(0, 0, 0, 0.03);
}
body.light-mode .glow-text {
    background: linear-gradient(to bottom, #1e293b, #64748b);
    -webkit-background-clip: text;
}

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

/* App Mockup */
.app-mockup {
    height: 500px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: relative;
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
    transition: transform 0.5s ease;
}

.app-mockup:hover {
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
}

.mockup-header {
    height: 50px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.5rem;
}

.mockup-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.mockup-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--glass-bg);
}

.mockup-user-info {
    display: flex;
    flex-direction: column;
}

.mockup-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.mockup-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mockup-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

.message {
    padding: 1rem;
    border-radius: 16px;
    max-width: 80%;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
}

.message.received {
    background: var(--mockup-received-bg);
    color: var(--mockup-received-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.sent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* RTL Support for Chat Bubbles */
body[dir="rtl"] .message.received {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 4px;
}

body[dir="rtl"] .message.sent {
    border-bottom-right-radius: 16px;
    border-bottom-left-radius: 4px;
}

/* Animations */
@keyframes message-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-msg {
    animation: message-appear 0.5s ease forwards;
}

.delay-1 { animation-delay: 0.5s; }
.delay-2 { animation-delay: 1.5s; }
.delay-3 { animation-delay: 2.5s; }
.delay-4 { animation-delay: 3.5s; }

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 1rem;
    background: var(--mockup-received-bg);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
    opacity: 0;
    transform: translateY(20px);
}

body[dir="rtl"] .typing-indicator {
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

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

.animate-typing {
    animation: message-appear 0.5s ease forwards;
}

/* Footer */
footer {
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 900px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .app-mockup {
        transform: none;
        max-width: 400px;
        margin: 0 auto;
        /* Re-trigger animation on mobile by removing hover dependency */
    }
    
    .app-mockup:hover {
        transform: none;
    }
}
