/* ============================================
   استایل ابزار جعبه لایتنر عربی هشتم
   ============================================ */

:root {
    --primary: #6f42c1;
    --primary-dark: #4a148c;
    --secondary: #e0e7ff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-body: #f1f5f9;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

.container {
    width: 100%;
    max-width: 480px;
    transition: opacity 0.3s ease;
    margin: 0 auto;
}

.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s ease; }

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

/* --- صفحه ورود --- */
.login-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 10vh;
}

.icon-header { 
    font-size: 3rem; 
    color: var(--primary); 
    margin-bottom: 1rem; 
}

.login-card h1 { 
    font-size: 1.5rem; 
    margin-bottom: 0.5rem; 
    color: var(--text-main); 
}

.login-card p { 
    color: var(--text-muted); 
    margin-bottom: 2rem; 
    font-size: 0.9rem; 
}

.input-group { 
    position: relative; 
    margin-bottom: 15px; 
}

.input-group i { 
    position: absolute; 
    right: 15px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--text-muted); 
}

.input-group input {
    width: 100%; 
    padding: 12px 45px 12px 15px;
    border: 2px solid #e2e8f0; 
    border-radius: 12px;
    font-size: 1rem; 
    background: #f8fafc; 
    transition: 0.3s;
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

.input-group input:focus { 
    border-color: var(--primary); 
    background: var(--white); 
    outline: none; 
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white); 
    border: none; 
    width: 100%; 
    padding: 14px;
    border-radius: 12px; 
    font-size: 1rem; 
    font-weight: bold; 
    cursor: pointer;
    transition: transform 0.1s;
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

.btn-primary:active { 
    transform: scale(0.98); 
}

.info-text { 
    margin-top: 15px; 
    font-size: 0.75rem; 
    color: var(--text-muted); 
}

/* --- داشبورد --- */
header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
}

.user-info { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.avatar {
    width: 45px; 
    height: 45px; 
    background: var(--secondary); 
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--primary); 
    font-size: 1.2rem;
}

.user-details { 
    display: flex; 
    flex-direction: column; 
}

.welcome { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
}

.name { 
    font-weight: bold; 
    font-size: 1rem; 
}

.btn-icon {
    background: var(--white); 
    border: none; 
    width: 40px; 
    height: 40px; 
    border-radius: 12px;
    color: var(--text-muted); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.stats-row { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 25px; 
}

.stat-card {
    flex: 1; 
    background: var(--white); 
    padding: 15px 10px; 
    border-radius: 16px;
    text-align: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 5px;
}

.stat-card i { 
    font-size: 1.2rem; 
}

.stat-card span { 
    font-size: 1.4rem; 
    font-weight: 800; 
}

.stat-card p { 
    font-size: 0.7rem; 
    color: var(--text-muted); 
    margin: 0; 
}

.stat-card.orange { 
    color: var(--warning); 
}

.stat-card.green { 
    color: var(--success); 
}

.stat-card.blue { 
    color: var(--primary); 
}

.action-area { 
    margin-bottom: 30px; 
}

.btn-large {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 18px 20px; 
    text-align: right; 
    margin-bottom: 10px;
}

.btn-content .title { 
    font-size: 1.1rem; 
    display: block; 
}

.btn-content .subtitle { 
    font-size: 0.8rem; 
    opacity: 0.8; 
    font-weight: normal; 
}

.btn-large i { 
    font-size: 1.5rem; 
    background: rgba(255,255,255,0.2); 
    width: 40px; 
    height: 40px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
}

.btn-secondary {
    background: var(--white); 
    border: 2px solid #e2e8f0; 
    color: var(--text-main);
    padding: 12px; 
    border-radius: 12px; 
    font-weight: bold; 
    cursor: pointer; 
    width: 100%;
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

.section-title {
    font-size: 1rem; 
    color: var(--text-main); 
    margin-bottom: 15px;
    border-right: 4px solid var(--primary); 
    padding-right: 10px; 
}

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

.lesson-card {
    background: var(--white); 
    padding: 20px; 
    border-radius: 16px; 
    cursor: pointer;
    text-align: center; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    position: relative;
    transition: transform 0.2s;
}

.lesson-card:hover { 
    transform: translateY(-3px); 
    border: 1px solid var(--secondary); 
}

.lesson-card h4 { 
    font-size: 0.95rem; 
    margin-bottom: 5px; 
}

.lesson-card span { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
}

.due-badge {
    position: absolute; 
    top: -5px; 
    left: -5px; 
    background: var(--danger); 
    color: white;
    font-size: 0.7rem; 
    padding: 2px 8px; 
    border-radius: 8px; 
    font-weight: bold;
}

/* --- فلش کارت --- */
.study-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
}

.btn-small {
    background: var(--white); 
    border: 1px solid #e2e8f0; 
    padding: 6px 12px;
    border-radius: 8px; 
    color: var(--text-main); 
    font-size: 0.85rem; 
    cursor: pointer;
    display: flex; 
    align-items: center; 
    gap: 5px;
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

.lesson-info { 
    text-align: center; 
}

.lesson-info #lesson-title { 
    display: block; 
    font-weight: bold; 
    font-size: 0.9rem; 
}

.counter { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    background: #e2e8f0; 
    padding: 2px 8px; 
    border-radius: 10px; 
}

.streak-icon { 
    color: var(--warning); 
    font-size: 1.2rem; 
}

.flashcard-area {
    height: 300px;
    width: 100%;
    perspective: 1000px;
    margin-bottom: 25px;
    position: relative;
}

.flashcard {
    width: 100%; 
    height: 100%; 
    position: relative;
    transform-style: preserve-3d; 
    transition: transform 0.6s; 
    cursor: pointer;
}

.flashcard.flipped { 
    transform: rotateY(180deg); 
}

.front, .back {
    position: absolute; 
    width: 100%; 
    height: 100%;
    backface-visibility: hidden; 
    border-radius: 20px;
    display: flex; 
    flex-direction: column; 
    padding: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.front { 
    background: linear-gradient(135deg, #ffffff, #f8fafc); 
}

.back {
    background: var(--white); 
    transform: rotateY(180deg);
    border: 2px solid var(--primary); 
    justify-content: center; 
    align-items: center;
}

.card-top { 
    display: flex; 
    justify-content: space-between; 
    width: 100%; 
    margin-bottom: auto; 
}

.box-badge {
    background: var(--secondary); 
    color: var(--primary-dark); 
    padding: 4px 10px;
    border-radius: 20px; 
    font-size: 0.75rem; 
    font-weight: bold;
}

.card-content {
    text-align: center; 
    flex: 1; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    width: 100%;
}

.word-arabic {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 900; 
    color: var(--text-main); 
    margin-bottom: 10px;
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

.hint { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    margin-top: 15px; 
    opacity: 0.8; 
}

.word-meaning { 
    font-size: 1.8rem; 
    font-weight: bold; 
    color: var(--primary); 
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

.controls { 
    display: flex; 
    gap: 12px; 
    margin-top: 10px; 
}

.btn-control {
    flex: 1; 
    border: none; 
    padding: 15px 10px; 
    border-radius: 14px;
    color: white; 
    cursor: pointer;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 6px;
    transition: transform 0.1s;
    font-family: 'Vazirmatn', 'Vazir', sans-serif;
}

.btn-control:active { 
    transform: scale(0.96); 
}

.btn-control span { 
    font-weight: 800; 
    font-size: 1rem; 
    white-space: nowrap; 
}

.btn-control small { 
    font-size: 0.7rem; 
    opacity: 0.9; 
    white-space: nowrap; 
}

.btn-danger { 
    background: var(--danger); 
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3); 
}

.btn-success { 
    background: var(--success); 
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3); 
}

.message {
    text-align: center; 
    margin-top: 15px; 
    padding: 10px;
    border-radius: 8px; 
    font-size: 0.9rem; 
    background-color: #ecfdf5; 
    color: #047857;
}

@media (max-width: 576px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        flex-direction: column;
    }
}

