/* ==========================================================
   ثيم الحديقة السحرية وعالم الفراشات (Magical Garden & Butterfly Theme)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2:wght@400;600;800&display=swap');

:root {
    --bg-color: #EDE7F6; /* Dreamy purple */
    --primary: #FCE4EC; /* Pastel Pink */
    --primary-dark: #F8BBD0;
    --secondary: #FFF176; /* Golden Star */
    --secondary-dark: #FFEE58;
    --accent: #F48FB1; /* Pink accent */
    --accent-dark: #EC407A;
    --success: #81C784; /* Soft green */
    --rose: #FF80AB;
    --text: #4A148C; /* Dark purple text */
    --white: #ffffff;
    --bg-card: #FCE4EC;
    --shadow: 0 8px 30px rgba(74, 20, 140, 0.15); 
    --border-dark: 2px solid rgba(74, 20, 140, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Baloo Bhaijaan 2', sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" style="font-size:30px"><text y="30">🌸</text></svg>') 10 30, auto !important;
}

body {
    background: linear-gradient(to bottom, #EDE7F6 0%, #FCE4EC 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text);
    overflow-x: hidden;
    padding-bottom: 120px;
    position: relative;
    font-size: 24px;
    line-height: 1.8;
}

/* ================== تأثيرات الخلفية ================== */
.garden-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -2;
    background: linear-gradient(to bottom, #EDE7F6 0%, #FCE4EC 100%);
    transition: background 1s ease;
    overflow: hidden;
}

.star-dust {
    position: absolute;
    bottom: -50px;
    background: rgba(255, 241, 118, 0.6); 
    border-radius: 50%;
    animation: floatUp infinite linear;
    box-shadow: 0 0 10px rgba(255, 241, 118, 0.8);
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-110vh) scale(0.5); opacity: 0; }
}

.cloud-shadow {
    position: absolute;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.4);
    animation: drift infinite linear;
    z-index: -2;
    filter: blur(2px);
}
@keyframes drift {
    0% { transform: translateX(110vw); }
    100% { transform: translateX(-30vw); }
}

/* ================== العناوين ================== */
.welcome-msg h2, .sosawy-logo, .lesson-overlay h2 {
    color: var(--primary-dark);
    font-size: 3.2rem;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 4px 10px rgba(142,68,173,0.2);
    margin: 20px 0;
    animation: gentleHover 3s ease-in-out infinite alternate;
    position: relative;
    z-index: 10;
}

/* ================== الهيدر العلوي ================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: transparent;
    border-bottom: none;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

.stars-panel {
    background: white;
    padding: 10px 22px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-dark);
    display: flex;
    align-items: center;
    gap: 15px;
    border: var(--border-dark);
    transition: transform 0.3s;
}

.stars-panel:hover {
    transform: translateY(-5px) scale(1.05);
}

.sosawy-tool-btn {
    background: var(--secondary);
    color: var(--text);
    border: 4px solid var(--secondary-dark);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 2rem;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1), inset 0 0 15px rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sosawy-tool-btn:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 25px rgba(255, 241, 118, 0.6);
}

.sosawy-tool-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 transparent;
}

/* ================== البطاقات ================== */
.sosawy-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.sosawy-grid, .sosawy-lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding: 20px 0;
}

.chapter-card, .lesson-card, .mode-card {
    background: linear-gradient(135deg, #FF80AB, #F48FB1);
    border-radius: 50% 50% 50% 10px; /* شكل الجناح */
    padding: 30px 20px;
    text-align: center;
    color: white;
    border: 4px solid #FFF176;
    box-shadow: 0 10px 20px rgba(236, 64, 122, 0.4), inset 0 0 15px rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 250px;
    margin: 0 auto;
    animation: gentleHover 3s infinite alternate ease-in-out;
}

.chapter-card::before, .lesson-card::before, .mode-card::before {
    display: none;
}

.chapter-icon {
    font-size: 5rem;
    margin-bottom: 10px;
    display: block;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.chapter-card h3, .lesson-card h3 { 
    font-size: 1.8rem; 
    font-weight: 900; 
    margin-bottom: 5px;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.chapter-card p, .lesson-card p { 
    font-size: 1.2rem; 
    font-weight: bold; 
    color: #FFF176; 
}

/* التفاعل */
.chapter-card:hover, .lesson-card:hover, .mode-card:hover {
    transform: scale(1.15) translateY(-10px);
    border-color: #FFF176;
    background: linear-gradient(135deg, #EC407A, #F48FB1);
    border-radius: 50% 50% 10px 50%;
}

.chapter-card:active, .lesson-card:active, .mode-card:active {
    transform: scale(0.95);
}

/* ================== أزرار الأكشن ================== */
.btn-action {
    background: white; 
    color: var(--accent-dark); 
    border: 6px solid var(--accent); 
    padding: 12px 40px; 
    border-radius: 50px; 
    font-size: 1.5rem; 
    font-weight: 900; 
    cursor: pointer; 
    transition: all 0.2s; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.btn-action.success {
    background: white;
    color: var(--success);
    border: 6px solid var(--success);
}

.btn-action::before, .btn-action::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 25px;
    background: var(--accent);
    z-index: -1;
}
.btn-action.success::before, .btn-action.success::after {
    background: var(--success);
}

.btn-action::before { left: 10px; }
.btn-action::after { right: 10px; }

.btn-action:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.btn-action:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* ================== نافذة الدروس (Overlay) ================== */
.sosawy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
}

.sosawy-overlay.hidden {
    display: none;
}

.close-btn {
    background: linear-gradient(135deg, #f3a683, #f78fb3);
    color: white;
    border: 3px solid #ffcccc;
    border-radius: 30px;
    padding: 10px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 6px 0 #cf6a87, 0 8px 15px rgba(247, 143, 179, 0.4);
    cursor: pointer;
    align-self: flex-start;
    margin-bottom: 20px;
    transition: 0.2s;
    width: auto;
    height: auto;
}
.close-btn:hover { transform: translateY(-3px); }
.close-btn:active { transform: translateY(6px); box-shadow: 0 0 0 #cf6a87; }

/* ================== الحركات ================== */
@keyframes gentleHover {
    from { transform: translateY(0) rotate(-2deg); }
    to { transform: translateY(-10px) rotate(2deg); }
}

@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.bounce-in {
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ================== Media Queries ================== */
@media (max-width: 768px) {
    .welcome-msg h2, .sosawy-logo, .lesson-overlay h2 { font-size: 2.2rem; }
    .main-header { flex-direction: column; gap: 15px; }
    .chapter-icon { font-size: 4rem; }
    .chapter-card h3, .lesson-card h3 { font-size: 1.5rem; }
    .btn-action { font-size: 1.2rem !important; padding: 10px 20px !important; }
    .sosawy-overlay { padding: 15px; }
    .chapter-card, .lesson-card, .mode-card { padding: 20px 10px; }
}

@media (max-width: 480px) {
    .chapter-card, .lesson-card, .mode-card { max-width: 150px; }
}

/* ================== زر الرئيسية ================== */
.home-btn-sea {
    position: fixed;
    top: 15px;
    right: 15px;
    background: var(--primary);
    color: var(--text);
    padding: 10px 25px;
    border: 3px solid var(--primary-dark);
    border-radius: 30px;
    text-decoration: none;
    font-weight: 900;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(108,92,231,0.2);
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.home-btn-sea:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(108,92,231,0.4);
}
.home-btn-sea:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* ================== الفوتر ================== */
.sosawy-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 1.2rem;
}
.sosawy-footer a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: bold;
}
.sosawy-footer a:hover {
    text-decoration: underline;
}
