:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --accent: #a855f7;
    
    /* Dark Mode Variables (Default) */
    --bg-dark: #0b0c10;
    --bg-nav: rgba(11, 12, 16, 0.8);
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #f5f6fa;
    --text-muted: #a4b0be;
    --input-bg: rgba(255, 255, 255, 0.02);
}

body.light-mode {
    --bg-dark: #f8f9fa;
    --bg-nav: rgba(248, 249, 250, 0.8);
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(0, 0, 0, 0.05);
    --text-main: #2f3542;
    --text-muted: #747d8c;
    --input-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Background Glow Effect */
.bg-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, rgba(168,85,247,0.05) 30%, rgba(0,0,0,0) 70%);
    z-index: -1;
    animation: rotateGlow 20s linear infinite;
}

body.light-mode .bg-glow {
    background: radial-gradient(circle, rgba(99,102,241,0.05) 0%, rgba(168,85,247,0.02) 30%, rgba(0,0,0,0) 70%);
}

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

/* Glassmorphism utility */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: var(--bg-nav);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(45deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    -webkit-text-fill-color: #6366f1;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: color 0.3s;
    padding: 8px 12px;
    border-radius: 8px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

body.light-mode .nav-links a:hover, body.light-mode .nav-links a.active {
    background: rgba(0,0,0,0.05);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    padding: 12px 28px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-small {
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
}

body.light-mode .btn-icon:hover {
    background: rgba(0,0,0,0.05);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-main);
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: #ff4757;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
}

.btn-danger:hover {
    background: #ff6b81;
}

/* Hero Section */
.hero {
    max-width: 1200px;
    margin: 100px auto 60px;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
}

.glow-text {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(to bottom right, #fff, #a4b0be);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .glow-text {
    background: linear-gradient(to bottom right, #2f3542, #747d8c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 500px;
}

/* Mockup */
.hero-mockup {
    display: flex;
    justify-content: center;
}

.phone-frame {
    width: 280px;
    height: 560px;
    background: #1e272e;
    border-radius: 40px;
    padding: 12px;
    border: 4px solid #2f3542;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.app-screen {
    background: #0b0c10;
    width: 100%;
    height: 100%;
    border-radius: 25px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: white; /* App always stays dark for design contrast */
}

.app-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.timeline {
    padding: 15px;
    flex: 1;
}

.timeline-item {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.time {
    font-size: 0.75rem;
    color: #a4b0be;
    width: 50px;
}

.activity {
    flex: 1;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.activity.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.activity h4 {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.activity p {
    font-size: 0.7rem;
    color: #a4b0be;
}

/* Simulator */
.simulator-section {
    max-width: 1200px;
    margin: 80px auto;
    padding: 40px 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.simulator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

textarea {
    width: 100%;
    height: 180px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 15px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    margin-bottom: 15px;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.output-area {
    background: rgba(0,0,0,0.1);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
}

body.light-mode .output-area {
    background: rgba(0,0,0,0.03);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Loader */
.loader {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 15px;
}

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

/* Simulated Timeline Result */
.sim-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 10px;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

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

/* Features Page Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.feature-card {
    padding: 30px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

input[type="email"] {
    width: 100%;
    padding: 12px;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    color: var(--text-main);
}

.form-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    margin-top: 60px;
}

.footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
}

/* Animations */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* LTR Support (for English) */
body.ltr {
    direction: ltr !important;
}

body.ltr .nav-links {
    flex-direction: row;
}

/* Responsive */
@media (max-width: 768px) {
    .hero, .simulator-container {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        display: none; /* In a real app, you'd add a burger menu */
    }
    
    .glow-text {
        font-size: 2.5rem;
    }
}

/* App Screenshots Section */
.screenshots-section {
    max-width: 1200px;
    margin: 80px auto;
    padding: 40px 20px;
    text-align: center;
}

.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.screenshot-card {
    border-radius: 20px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: transform 0.3s;
}

.screenshot-card:hover {
    transform: translateY(-5px);
}

.app-screenshot {
    width: 100%;
    height: auto;
    display: block;
    /* Clean crop to remove phone status bar and bottom bar */
    clip-path: inset(5% 0 5% 0);
    margin-top: -5%;
    margin-bottom: -5%;
}

/* Problem Section */
.problem-section {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px 20px;
    text-align: center;
}

.problem-content {
    padding: 30px;
    border-radius: 16px;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-main);
}

/* Features Section (Main Page) */
.features-section {
    max-width: 1200px;
    margin: 60px auto;
    padding: 40px 20px;
}

/* Newsletter Section */
.newsletter-section {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px 20px;
    text-align: center;
}

.newsletter-container {
    padding: 30px;
    border-radius: 16px;
    margin-top: 20px;
}

#newsletterForm {
    display: flex;
    gap: 15px;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
}

#newsletterForm input[type="email"] {
    flex: 1;
    min-width: 250px;
}

@media (max-width: 600px) {
    #newsletterForm {
        flex-direction: column;
    }
}


