:root {
    --primary-color: #0097e6; /* Bright Blue */
    --secondary-color: #00a8ff; /* Light Blue */
    --bg-color: #eaf6ff; /* Light Sky Blue */
    --card-bg: #ffffff;
    --text-color: #2f3640; /* Dark slate */
    --accent-color: #ff9f43; /* Bright Orange */
    --correct-color: #2ed573;
    --wrong-color: #ff4757;
}

* {
    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(0, 151, 230, 0.1) 0, rgba(0, 151, 230, 0.1) 10px, transparent 10px), radial-gradient(circle at 0 0, rgba(255, 159, 67, 0.1) 0, rgba(255, 159, 67, 0.1) 10px, transparent 10px);
    background-size: 30px 30px;
}

.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 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 25px;
    box-shadow: 0 8px 20px rgba(0, 151, 230, 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: linear-gradient(145deg, #ffffff, #f0f8ff);
    border-radius: 25px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 8px 8px 16px rgba(0, 151, 230, 0.1), 
               -8px -8px 16px rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lesson-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.lesson-card:hover, .lesson-card:active {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 12px 12px 20px rgba(0, 151, 230, 0.15), 
               -12px -12px 20px rgba(255, 255, 255, 0.9);
    border-color: var(--secondary-color);
}

.lesson-card:hover::before {
    opacity: 1;
}

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

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

.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: transform 0.2s;
}
.learn-item:hover {
    transform: scale(1.02);
    background: #eaf6ff;
}
.learn-item.playing {
    border-style: solid;
    border-color: var(--primary-color);
    background: #dff0ff;
}

.learn-icon {
    font-size: 3.5rem;
    margin-left: 20px;
}
.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;
}


.masculine-decor {
    position: fixed;
    z-index: -1;
    font-size: 4rem;
    opacity: 0.15;
    pointer-events: none;
    animation: floatAnim 10s infinite alternate ease-in-out;
}
.rocket { top: 10%; left: 10%; animation-duration: 8s; }
.planet { top: 60%; right: 15%; animation-duration: 12s; font-size: 6rem; }
.robot { 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; }
}

