:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-english: 'Outfit', sans-serif;
    --font-arabic: 'Amiri', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-english);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Orbs for aesthetic */
.background-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 20s infinite alternate ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #4c1d95;
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #1e3a8a;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #064e3b;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, #c4b5fd, #8b5cf6, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero p {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--text-muted);
    max-width: 600px;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    animation: bounce 2s infinite;
    color: var(--text-muted);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

/* Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Ayah Card */
.ayah-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ayah-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.ayah-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.ayah-header h2 {
    font-weight: 600;
    color: #c4b5fd;
    font-size: 1.5rem;
}

.ayah-number {
    background: rgba(139, 92, 246, 0.2);
    color: #ddd6fe;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Typography */
.arabic-text {
    font-family: var(--font-arabic);
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-align: right;
    direction: rtl;
    line-height: 1.8;
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.arabic-inline {
    font-family: var(--font-arabic);
    font-size: 1.3em;
    font-weight: normal;
}

.english-translation {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

.section-divider {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #64748b;
    margin: 3rem 0 1.5rem 0;
    display: flex;
    align-items: center;
}

.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
    margin-left: 1rem;
}

/* Grammar Breakdown */
.grammar-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.word-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: background 0.3s ease;
}

.word-card:hover {
    background: rgba(255,255,255,0.05);
}

.word-card .arabic-word {
    font-family: var(--font-arabic);
    font-size: 2rem;
    text-align: right;
    color: #a78bfa;
    margin-bottom: 0.5rem;
}

.word-card .transliteration {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.word-card .explanation {
    font-size: 0.95rem;
    line-height: 1.5;
}

.root-letters {
    font-family: var(--font-arabic);
    font-size: 1.2rem;
    color: #34d399;
    padding: 0 4px;
}

/* What If Section */
.what-if-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.what-if-toggle {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-english);
    font-size: 1.1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.what-if-toggle:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}

.what-if-toggle.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    background: rgba(139, 92, 246, 0.1);
}

.what-if-toggle .icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.what-if-toggle.active .icon {
    transform: rotate(45deg);
}

.what-if-content {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.what-if-content.open {
    max-height: 300px;
    padding: 1.5rem;
}

/* Memorize Game */
.memorize-game {
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.game-instructions {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.game-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    direction: rtl;
    margin-bottom: 2rem;
}

.game-word {
    font-family: var(--font-arabic);
    font-size: 2rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.game-word.hidden {
    color: transparent;
    background: rgba(139, 92, 246, 0.2);
    border: 1px dashed var(--accent);
}

.game-word.hidden:hover {
    background: rgba(139, 92, 246, 0.4);
}

.game-word:not(.hidden) {
    color: #fff;
    cursor: default;
}

.btn-reset {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 20px;
    font-family: var(--font-english);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-reset:hover {
    background: var(--accent-hover);
}

footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
}

.footer-credits {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 768px) {
    .ayah-card {
        padding: 2rem;
    }
    
    .grammar-breakdown {
        grid-template-columns: 1fr;
    }
    
    .game-word {
        font-size: 1.5rem;
    }
}
