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

:root {
    /* ألوان هادئة وحديثة (Modern Pastel) */
    --bg-color: #f0f4f8;
    --primary-color: #5D5FEF;
    --primary-light: #A5A6F6;
    --secondary-color: #38bdf8;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 50px rgba(93, 95, 239, 0.15);
}

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

/* خلفية نظيفة مع تأثير أورورا (Glow Orbs) هادئ */
body {
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    color: var(--text-main);
    position: relative;
}

.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 15% 50%, rgba(93, 95, 239, 0.1), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(56, 189, 248, 0.1), transparent 25%);
}

.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
    animation: slowDrift 20s ease-in-out infinite alternate;
}

.circle { width: 400px; height: 400px; background: #5D5FEF; top: -10%; left: -10%; }
.square { width: 300px; height: 300px; background: #38bdf8; bottom: -5%; right: -5%; animation-delay: -5s; }
.triangle { width: 350px; height: 350px; background: #f472b6; top: 40%; left: 50%; transform: translate(-50%, -50%); animation-delay: -10s; }
.bubble1, .bubble2 { display: none; } /* إخفاء الأشكال الزائدة */

@keyframes slowDrift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* الشاشات وحركتها الناعمة (Fade & Slide Up) */
.screen {
    width: 100%;
    max-width: 1100px;
    padding: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
}

.screen.active {
    display: flex;
    animation: smoothFadeUp 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes smoothFadeUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* البطاقة الزجاجية الحديثة */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.8);
    max-width: 420px;
    width: 100%;
}

.glass-card h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.glass-card p {
    font-size: 1.2rem;
    margin-bottom: 35px;
    color: var(--text-muted);
}

/* حقل الإدخال */
.input-group { margin-bottom: 30px; }

input[type="text"] {
    width: 100%;
    padding: 16px 20px;
    border-radius: 16px;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
    color: var(--text-main);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

input[type="text"]:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(93, 95, 239, 0.1);
    background: #fff;
}

/* الأزرار بتأثير ناعم ومميز */
.btn {
    padding: 16px 40px;
    border: none;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    color: white;
}

.primary-btn {
    background: var(--primary-color);
    width: 100%;
    box-shadow: 0 8px 20px rgba(93, 95, 239, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(93, 95, 239, 0.4);
    background: #4f51e0;
}

.primary-btn:active {
    transform: translateY(1px);
}

.secondary-btn {
    background: #fff;
    color: var(--text-main);
    padding: 10px 25px;
    font-size: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.secondary-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* شاشة الدرس - لافتة الترحيب */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 20px 40px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.welcome-banner h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 800;
}

/* شبكة الكلمات التفاعلية */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    width: 100%;
    padding-bottom: 50px;
}

.word-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    transform: translateY(20px);
    animation: smoothFadeUp 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* تأثير الـ Hover على البطاقة (Modern Lift) */
.word-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    background: #ffffff;
}

/* الصور داخل البطاقة */
.word-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.word-card:hover .word-img {
    transform: scale(1.08);
}

.word-ar {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    display: block;
    margin-bottom: 5px;
}

.word-en {
    font-size: 1.1rem;
    color: var(--text-muted);
    display: block;
    font-weight: 600;
}

/* تأثير النطق (توهج هادئ) */
.speaking {
    border: 2px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
    transform: scale(1.02);
}

/* اهتزاز هادئ عند الخطأ */
.bounce-in {
    animation: smoothShake 0.4s ease-in-out;
}

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

/* تحسين الموبايل */
@media (max-width: 600px) {
    .glass-card { padding: 40px 25px; }
    .glass-card h1 { font-size: 2.2rem; }
    .word-img { width: 85px; height: 85px; }
    .word-ar { font-size: 1.4rem; }
    .welcome-banner { flex-direction: column; text-align: center; gap: 15px; }
    .welcome-banner h2 { font-size: 1.5rem; }
}
