:root {
    --primary: #E91E63;
    --primary-light: #F48FB1;
    --secondary: #9C27B0;
    --emerald-deep: #C2185B;
    --emerald-mid: #E040FB;
    --emerald-light: #FCE4EC;
    --gold: #FFD700;
    --bg-color: #FFF0F5;
    --text-main: #333333;
    --card-bg: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: linear-gradient(-45deg, var(--bg-color), #fff, var(--emerald-light), #fff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.clickable-text {
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    display: inline-block;
}
.clickable-text:hover {
    transform: scale(1.05);
    color: var(--primary);
}
.clickable-text::after {
    content: '\f028';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6em;
    margin-right: 5px;
    opacity: 0.5;
    color: var(--secondary);
    vertical-align: middle;
}

body.theme-quran {
    --bg-color: #FDF4F6;
    --primary: #C2185B;
    --primary-light: #F48FB1;
    --card-bg: #ffffff;
}

#app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.7);
    color: var(--primary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 30px 30px;
    margin-bottom: 2.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-section h1 {
    font-size: 1.8rem;
    font-weight: 800;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-header {
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 10px rgba(233, 30, 99, 0.1);
}

.btn-header:hover {
    background: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.2);
}

/* Main Content */
main {
    flex: 1;
    padding: 0 2rem;
}

.hero-dashboard {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: var(--primary);
    padding: 3rem 2rem;
    border-radius: 30px;
    margin-bottom: 3rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(233, 30, 99, 0.1);
    position: relative;
    overflow: hidden;
}

.hero-content h2 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.8);
}

.hero-content p {
    font-size: 1.3rem;
    color: var(--text-main);
    font-weight: 700;
}

/* Grid & Cards */
.units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.unit-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-top: 6px solid var(--secondary);
    position: relative;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.unit-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(156, 39, 176, 0.15);
}

.unit-badge {
    position: absolute;
    top: -15px;
    right: 20px;
    background: var(--secondary);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

.unit-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--primary);
}

.lesson-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lesson-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #eee;
}

.lesson-item:hover {
    background: var(--emerald-light);
    border-color: var(--emerald-mid);
}

.lesson-item.completed {
    background: #e8f5e9;
    border-color: #81c784;
}

.lesson-item.completed .status-icon i {
    color: #4CAF50;
}

.lesson-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: bold;
}

.status-icon i {
    font-size: 1.4rem;
    color: #ccc;
    transition: color 0.3s ease;
}

/* Lesson View */
.lesson-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    padding: 3rem 2rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.tabs-container {
    display: flex;
    gap: 10px;
    margin-bottom: 2rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.section-title {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Quranic Text */
.surah-text {
    font-family: 'Amiri', serif;
    font-size: 2.2rem;
    line-height: 2.2;
    text-align: center;
    padding: 2rem;
    background: #fffcf0;
    border: 2px solid var(--gold);
    border-radius: 15px;
}

.verse-item {
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline;
}

.verse-item:hover {
    color: var(--primary);
}

.verse-item.active {
    color: var(--emerald-deep);
    font-weight: bold;
    background: var(--emerald-light);
    border-radius: 5px;
}

.verse-number {
    font-family: 'Amiri', serif;
    color: var(--gold);
    font-size: 1.8rem;
    margin: 0 5px;
}

/* Audio Controls */
.audio-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.btn-circle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.btn-circle:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 12px 25px rgba(233, 30, 99, 0.6);
}

#stop-btn {
    background: #e74c3c;
}

.audio-hint {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.audio-hint i {
    color: var(--primary);
}

/* Content Cards */
.content-header {
    color: var(--primary);
    font-size: 1.8rem;
    margin: 2rem 0 1.5rem 0;
    text-align: center;
    padding-bottom: 10px;
    width: 100%;
}

.content-card {
    display: flex;
    align-items: center;
    background: rgba(255, 240, 245, 0.7);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 15px 25px;
    margin-bottom: 15px;
    gap: 20px;
    box-shadow: 0 8px 16px rgba(233, 30, 99, 0.08);
    width: 100%;
    text-align: right;
    transition: transform 0.3s ease, background 0.3s ease;
}

.content-card:hover {
    transform: translateX(-5px) scale(1.01);
    background: rgba(255, 255, 255, 0.9);
}

.content-icon {
    font-size: 3rem;
    min-width: 65px;
    text-align: center;
    background: white;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.content-text {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--emerald-deep);
}

/* Sidebar */
#achievements-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    padding: 2rem;
    overflow-y: auto;
}

#achievements-sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sidebar-header h2 {
    color: var(--primary);
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.badge-item {
    background: #f8f9fa;
    border: 2px dashed #ccc;
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.badge-item.unlocked {
    background: #fffcf0;
    border: 2px solid var(--gold);
    opacity: 1;
}

.badge-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.badge-name {
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Animations */
.animate-in {
    animation: fadeIn 0.5s ease forwards;
}

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

.animate-view-change {
    animation: slideIn 0.4s ease forwards;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-weight: bold;
}

@media (max-width: 768px) {
    header { padding: 1rem; border-radius: 0 0 15px 15px; flex-direction: column; gap: 10px; }
    .logo-section h1 { font-size: 1.5rem; }
    .hero-dashboard { padding: 1.5rem; }
    .hero-content h2 { font-size: 1.8rem; }
    .hero-content p { font-size: 1.1rem; }
    .units-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .unit-card { padding: 1.5rem; }
    .lesson-card { padding: 1.5rem 1rem; }
    .surah-text { font-size: 1.6rem; padding: 1rem; line-height: 2; }
    .verse-number { font-size: 1.3rem; }
    .content-card { flex-direction: column; text-align: center; padding: 15px; gap: 10px; }
    #achievements-sidebar { width: 100%; right: -100%; padding: 1.5rem; }
    .section-title { font-size: 1.6rem; }
    .badge-grid { grid-template-columns: 1fr 1fr; }
}
