:root {
    --primary-color: #ff758c;
    --secondary-color: #ff7eb3;
    --bg-color: #fff0f5; /* Lavender Blush */
    --card-bg: #ffffff;
    --text-color: #5d4037;
    --accent-color: #a18cd1;
    --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(255,117,140,0.1) 0, rgba(255,117,140,0.1) 10px, transparent 10px), radial-gradient(circle at 0 0, rgba(255,126,179,0.1) 0, rgba(255,126,179,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(255, 117, 140, 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(250px, 1fr));
    gap: 20px;
}

.lesson-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 3px solid transparent;
}

.lesson-card:hover, .lesson-card:active {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px rgba(255, 117, 140, 0.3);
    border-color: var(--secondary-color);
}

.lesson-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.lesson-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
}

/* 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), #fbc2eb);
    color: white;
    box-shadow: 0 5px 15px rgba(161, 140, 209, 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 #ffb8c6;
    cursor: pointer;
    transition: transform 0.2s;
}
.learn-item:hover {
    transform: scale(1.02);
    background: #fff0f5;
}
.learn-item.playing {
    border-style: solid;
    border-color: var(--primary-color);
    background: #ffe3e8;
}

.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(161, 140, 209, 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(161, 140, 209, 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;
}
