:root {
    /* Color Palette */
    --primary-teal: #2A9D8F;
    --primary-dark: #1E443F;
    --secondary-gold: #E9C46A;
    --accent-orange: #F4A261;
    --text-white: #FFFFFF;
    --bg-light: #F8F9FA;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Splash Screen */
#splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    color: white;
    transition: opacity 1s ease-out, visibility 1s;
}

#splash.hidden {
    opacity: 0;
    visibility: hidden;
}

.splash-logo {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Glass UI */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.progress-container {
    height: 6px;
    background: #eee;
    margin-bottom: 2rem;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-teal), var(--secondary-gold));
    transition: width 0.5s ease-in-out;
}

body {
    font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--primary-dark);
    direction: rtl;
    line-height: 1.6;
    overflow-x: hidden;
}

#app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
#global-header {
    background: var(--primary-dark);
    color: var(--text-white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

#global-header.hidden {
    display: none;
}

.user-stats {
    display: flex;
    gap: 1rem;
}

#main-nav {
    display: flex;
    gap: 0.5rem;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: var(--transition-smooth);
}

/* Home Section Styles */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-teal));
    color: var(--text-white);
    text-align: center;
    padding: 2rem;
}

.hero-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-slogan {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-primary {
    background-color: var(--secondary-gold);
    color: var(--primary-dark);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.25rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
    background-color: #fbd38d;
}

/* Map Section Styles */
.map-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.map-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-dark);
    text-align: center;
}

.world-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.world-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.world-content {
    padding: 1.5rem;
}

/* Story Container */
.story-container {
    max-width: 800px;
    margin: 1rem auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 40px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    scroll-behavior: smooth;
}

/* Dialogue v2.0 Styles */
.story-node {
    margin-bottom: 2rem;
}

.animation-fadeIn {
    animation: fadeIn 0.5s ease-out forwards;
}

.choices-container {
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.choice-btn {
    border: 1px solid var(--primary-teal);
    background: white;
    color: var(--primary-dark);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    text-align: right;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.choice-btn:hover {
    background: var(--primary-teal);
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.choice-btn:active {
    transform: scale(0.98);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dialogue-box {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: fadeIn 0.5s ease-out;
    cursor: pointer;
}

.character-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.bubble {
    padding: 1rem 1.5rem;
    border-radius: 15px;
    background: #f0f2f5;
    position: relative;
    max-width: 80%;
}

.bubble.scientific {
    background: #e7f3f2;
    border-right: 4px solid var(--primary-teal);
}

.bubble::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent transparent #f0f2f5;
}

.bubble.scientific::after {
    border-color: transparent transparent transparent #e7f3f2;
}

/* Interaction Styles */
.option-btn:hover {
    background: #e9ecef !important;
    border-color: var(--primary-teal) !important;
    transform: translateX(-5px);
}

.chapter-item.locked {
    background: #f1f1f1 !important;
    border: 1px dashed #ccc !important;
}

.chapter-item:not(.locked):hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-teal) !important;
    transform: translateX(-5px);
}

/* Game Framework v2.3 Styles */
.dd-btn,
.match-btn,
.timeline-item,
.puzzle-piece {
    transition: var(--transition-smooth);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
}

.dd-btn:hover,
.match-btn:hover,
.timeline-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.puzzle-piece {
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.puzzle-target {
    transition: background 0.3s ease;
    border: 2px dashed rgba(255, 255, 255, 0.4);
}

.animation-slideUp {
    animation: fadeIn 0.6s ease-out;
}

/* Custom Scrollbar */
.story-container::-webkit-scrollbar {
    width: 8px;
}

.story-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.story-container::-webkit-scrollbar-thumb {
    background: var(--primary-teal);
    border-radius: 10px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .story-container {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 15px;
    }

    .bubble {
        max-width: 90%;
    }

    .worlds-grid {
        grid-template-columns: 1fr;
    }
}