:root {
    --primary-color: #4B5320; /* Army Green */
    --secondary-color: #556B2F; /* Dark Olive Green */
    --bg-color: #E5D3B3; /* Sand Beige */
    --card-bg: #FAF3E0; /* Light Beige */
    --text-color: #2C3E50; /* Matte Black */
    --accent-color: #D35400; /* Rust Orange */
    --correct-color: #27ae60;
    --wrong-color: #c0392b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image: radial-gradient(circle at 100% 100%, rgba(75, 83, 32, 0.05) 0, rgba(75, 83, 32, 0.05) 15px, transparent 15px), radial-gradient(circle at 0 0, rgba(211, 84, 0, 0.05) 0, rgba(211, 84, 0, 0.05) 15px, transparent 15px);
    background-size: 40px 40px;
}

.view {
    display: none;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}
.active-view {
    display: block;
    animation: fadeIn 0.5s;
}

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

/* Header as Dashboard */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #2C3E50; /* Matte Black Dashboard */
    color: #E5D3B3;
    border-radius: 15px;
    border: 4px solid var(--primary-color);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    cursor: pointer;
}

.header p {
    font-size: 1.2rem;
    cursor: pointer;
}

/* Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 10px;
}

.lesson-card {
    background: #E5D3B3;
    background-image: repeating-linear-gradient(45deg, rgba(75,83,32,0.1) 0px, rgba(75,83,32,0.1) 10px, transparent 10px, transparent 20px);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 5px solid #556B2F;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lesson-card::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px;
    width: 15px; height: 15px;
    background: #2C3E50;
    border-radius: 50%;
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.5);
    pointer-events: none;
}

.lesson-card::after {
    content: '';
    position: absolute;
    top: 10px; right: 10px;
    width: 15px; height: 15px;
    background: #2C3E50;
    border-radius: 50%;
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.5);
    pointer-events: none;
}

.lesson-card:hover, .lesson-card:active {
    transform: translateY(-8px) scale(1.03) rotate(-2deg);
    box-shadow: 8px 12px 20px rgba(0, 0, 0, 0.4);
    border-color: #D35400;
}

.lesson-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s ease-in-out;
    background: #FAF3E0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    line-height: 100px;
    border: 3px dashed #D35400;
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.1);
}

.lesson-card:hover .lesson-icon {
    transform: scale(1.15) rotate(10deg);
}

.lesson-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-color);
    line-height: 1.4;
}

/* Top Bar in Lesson View */
.top-bar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.back-btn {
    background: white;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.back-btn:hover {
    background: var(--accent-color);
    color: white;
}

#lesson-title {
    font-size: 1.8rem;
    color: var(--text-color);
    cursor: pointer;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    font-size: 1.3rem;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    background: #e0e0e0;
    color: #555;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent-color), #ffb142);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 159, 67, 0.4);
}

.tab-content {
    display: none;
}
.active-tab {
    display: block;
    animation: fadeIn 0.4s;
}

.content-box {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

/* Learn Elements */
.learn-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 15px;
    background: #fdfbfb;
    border-radius: 15px;
    border: 2px dashed #74b9ff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.learn-item:hover {
    transform: scale(1.03) rotate(1deg);
    background: var(--card-bg);
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.learn-item.playing {
    border-style: solid;
    border-color: var(--primary-color);
    background: #dff0ff;
}

.learn-icon {
    font-size: 3.5rem;
    margin-left: 20px;
    transition: transform 0.3s;
}
.learn-item:hover .learn-icon {
    animation: bounceIcon 0.5s infinite alternate;
}

@keyframes bounceIcon {
    from { transform: translateY(0) scale(1.1); }
    to { transform: translateY(-10px) scale(1.1); }
}

.learn-text {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.5;
}

/* Games Elements */
.game-container {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f4f6f9;
    border-radius: 20px;
}
.game-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--accent-color);
    cursor: pointer;
}

/* Sorting Game */
.sort-item {
    font-size: 4rem;
    margin: 10px;
    cursor: grab;
    display: inline-block;
    background: white;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.sort-item:active { cursor: grabbing; }

.drop-zones {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
.drop-zone {
    flex: 1;
    min-height: 150px;
    border: 3px dashed var(--accent-color);
    border-radius: 20px;
    padding: 15px;
    background: rgba(255, 159, 67, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 10px;
    transition: background 0.3s;
}
.drop-zone.hovered {
    background: rgba(255, 159, 67, 0.2);
}
.drop-zone-title {
    width: 100%;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 10px;
    cursor: pointer;
}

/* Multiple Choice Game */
.mcq-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.mcq-btn {
    padding: 15px 30px;
    font-size: 2rem;
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}
.mcq-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.mcq-btn.correct {
    border-color: var(--correct-color);
    background: #e8f9f0;
}
.mcq-btn.wrong {
    border-color: var(--wrong-color);
    background: #ffe9eb;
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.clickable-text {
    cursor: pointer;
}
.clickable-text:active {
    opacity: 0.7;
}


.safari-decor {
    position: fixed;
    z-index: -1;
    font-size: 4rem;
    opacity: 0.15;
    pointer-events: none;
    animation: floatAnim 10s infinite alternate ease-in-out;
}
.tree { top: 10%; left: 10%; animation-duration: 8s; }
.compass { top: 60%; right: 15%; animation-duration: 12s; font-size: 6rem; }
.jeep { bottom: 10%; left: 20%; animation-duration: 9s; }

@keyframes floatAnim {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(10px) rotate(-5deg); }
}

.view.active-view, .tab-content.active-tab {
    animation: flyIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes flyIn {
    0% { transform: translateX(-100vw); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

