/* ========== فونت محلی (آفلاین) ========== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
    min-height: 100vh;
    color: #1e293b;
    direction: rtl;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* ========== صفحه اصلی ========== */
.main-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    background: 
        radial-gradient(ellipse at 20% 20%, #e0f2fe 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, #fce7f3 0%, transparent 50%),
        linear-gradient(160deg, #f8fafc 0%, #f1f5f9 100%);
}

.logo-area {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

.logo-area img {
    width: 140px;
    height: 140px;
    margin-bottom: 18px;
    border-radius: 28px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.14);
    transition: transform 0.3s ease;
}

.logo-area img:hover {
    transform: scale(1.05) rotate(-2deg);
}

.school-name {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    padding: 0 10px;
}

.grade-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 340px;
    animation: fadeInUp 0.6s ease 0.15s both;
}

.grade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px;
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    text-decoration: none;
    border-radius: 16px;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
}

.grade-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.5s ease;
}

.grade-btn:hover::before {
    left: 100%;
}

.grade-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.16);
}

.btn-10 { background: linear-gradient(135deg, #f472b6 0%, #db2777 100%); }
.btn-11 { background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%); }
.btn-12 { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); }

/* ========== صفحات پایه‌ها ========== */
.grade-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-10 { background: linear-gradient(180deg, #fdf2f8 0%, #fce7f3 40%, #fbcfe8 100%); }
.page-11 { background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 40%, #bae6fd 100%); }
.page-12 { background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 40%, #fde68a 100%); }

.school-header {
    text-align: center;
    padding: 16px 16px 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #334155;
}

.grade-title-box {
    text-align: center;
    margin: 6px auto 18px;
    padding: 12px 32px;
    border-radius: 14px;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    box-shadow: 0 5px 16px rgba(0,0,0,0.12);
    max-width: fit-content;
}

.title-10 { background: linear-gradient(135deg, #f472b6 0%, #db2777 100%); }
.title-11 { background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%); }
.title-12 { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); }

.back-area {
    text-align: center;
    margin-bottom: 16px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: rgba(255,255,125,0.8);
    color: #334155;
    text-decoration: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    transition: all 0.25s ease;
    border: 1px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.back-link:hover {
    background: white;
    color: #0f172a;
    transform: translateY(-2px);
}

/* بخش کتاب‌ها */
.books-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 14px 40px;
    flex: 1;
    width: 100%;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.book-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(6px);
    border-radius: 14px;
    text-decoration: none;
    color: #1e293b;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border: 1.5px solid rgba(255,255,255,0.9);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.book-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform 0.25s ease;
    opacity: 0.5;
}

.book-btn:hover {
    transform: translateY(-4px);
    background: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.book-btn:hover::after {
    transform: scaleX(1);
}

.book-icon {
    font-size: 1.7rem;
    line-height: 1;
    transition: transform 0.25s ease;
}

.book-btn:hover .book-icon {
    transform: scale(1.12);
}

/* فوتر */
.simple-footer {
    text-align: center;
    padding: 14px 10px;
    color: #64748b;
    font-size: 0.8rem !important;
    font-weight: 500;
    opacity: 0.8;
}

/* انیمیشن‌ها */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* ========== ریسپانسیو ========== */

/* تبلت */
@media (max-width: 900px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* موبایل بزرگ */
@media (max-width: 600px) {
    .school-name {
        font-size: 1.25rem;
    }

    .school-header {
        font-size: 0.95rem;
        padding: 14px 12px 6px;
    }

    .grade-title-box {
        font-size: 1.3rem;
        padding: 11px 24px;
        margin-bottom: 14px;
    }

    .grade-btn {
        font-size: 1.2rem;
        padding: 16px 20px;
    }

    .logo-area img {
        width: 110px;
        height: 110px;
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .book-btn {
        min-height: 90px;
        padding: 14px 6px;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    .book-icon {
        font-size: 1.5rem;
    }

    .books-section {
        padding: 6px 10px 30px;
    }
}

/* موبایل کوچک */
@media (max-width: 380px) {
    .school-name {
        font-size: 1.1rem;
    }

    .grade-title-box {
        font-size: 1.15rem;
        padding: 10px 18px;
    }

    .grade-btn {
        font-size: 1.1rem;
        padding: 15px 16px;
    }

    .books-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .book-btn {
        min-height: 82px;
        font-size: 0.88rem;
        padding: 12px 4px;
    }
}
