/**
 * style.css
 * استایل اصلی پروژه رتبه بیار
 * شامل فونت، ریست، گرید، فرم‌ها، هدر، فوتر، داشبورد و کلاس‌های کمکی
 * طراحی Mobile-First
 */

/* ========== تعریف فونت ========== */
@font-face {
    font-family: 'Iran';
    src: url('../fonts/Iran.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ========== ریست و استایل‌های پایه ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Iran', Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: #f5f5f5;
    color: #202124;
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========== کانتینر ========== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ========== سیستم گرید ۱۲ ستونه ========== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

[class^="col-"] {
    padding: 0 10px;
    width: 100%;
}

.col-1 { width: 8.333%; }
.col-2 { width: 16.666%; }
.col-3 { width: 25%; }
.col-4 { width: 33.333%; }
.col-5 { width: 41.666%; }
.col-6 { width: 50%; }
.col-7 { width: 58.333%; }
.col-8 { width: 66.666%; }
.col-9 { width: 75%; }
.col-10 { width: 83.333%; }
.col-11 { width: 91.666%; }
.col-12 { width: 100%; }

/* ========== هدر ========== */
.main-header {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1a73e8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo::before {
    content: '🏆';
    font-size: 1.4rem;
}

/* منوی ناوبری */
.main-nav ul {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-nav ul li a {
    display: block;
    padding: 8px 14px;
    border-radius: 6px;
    color: #202124;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

.main-nav ul li a:hover {
    background: #e8f0fe;
    color: #1a73e8;
}

/* دکمه همبرگری */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #202124;
    padding: 5px;
    line-height: 1;
}

/* ========== محتوای اصلی ========== */
.main-content {
    flex: 1;
    padding: 25px 0;
}

/* ========== فوتر ========== */
.main-footer {
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    padding: 20px 0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-top: auto;
}

/* ========== فرم‌ها ========== */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 20px;
}

.form-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px 25px;
    width: 100%;
    max-width: 450px;
}

.form-card h2 {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #dadce0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Iran', Tahoma, sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* ========== دکمه‌ها ========== */
.btn {
    display: inline-block;
    padding: 11px 22px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'Iran', Tahoma, sans-serif;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-align: center;
    font-weight: 500;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
}
.btn-primary:hover {
    background: #1557b0;
}

.btn-success {
    background: #0f9d58;
    color: #fff;
}
.btn-success:hover {
    background: #0b8043;
}

.btn-danger {
    background: #d93025;
    color: #fff;
}
.btn-danger:hover {
    background: #b3261e;
}

.btn-warning {
    background: #f9ab00;
    color: #202124;
}
.btn-warning:hover {
    background: #e09800;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ========== هشدارها و فلش مسج‌ها ========== */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    font-size: 0.9rem;
}

.alert-success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #0f9d58;
}

.alert-error {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #d93025;
}

.alert-warning {
    background: #fef7e0;
    color: #b06000;
    border: 1px solid #f9ab00;
}

.alert .close-btn {
    position: absolute;
    top: 8px;
    left: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}
.alert .close-btn:hover {
    opacity: 1;
}

.flash-message {
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    font-size: 0.9rem;
}

.success-message {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #0f9d58;
}

.error-message {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #d93025;
}

/* خطای فیلد */
.field-error {
    color: #d93025;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ========== کارت‌های داشبورد ========== */
.welcome-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 25px;
    margin-bottom: 25px;
}

.welcome-card h2 {
    color: #1a73e8;
    margin-bottom: 8px;
}

.welcome-card p {
    color: #666;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.menu-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 25px 20px;
    display: block;
    text-decoration: none;
    color: #202124;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.menu-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.menu-card h3 {
    color: #1a73e8;
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.menu-card p {
    color: #666;
    font-size: 0.9rem;
}

/* ========== جدول‌ها ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-table thead {
    background: #1a73e8;
    color: #fff;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: right;
}

.data-table tbody tr {
    border-bottom: 1px solid #e8eaed;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.data-table tbody tr:nth-child(even):hover {
    background: #f1f3f4;
}

/* ========== کلاس‌های کمکی ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 40px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 40px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.hidden { display: none !important; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ========== اضافه شدن به css/style.css ========== */
/* استایل Modalها */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-half {
    width: 50%;
}

@media (max-width: 768px) {
    .modal-half {
        width: 90%;
    }
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
}

.close {
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}

.close:hover {
    color: #000;
}

/* نوار ابزار نمادهای ریاضی */
.symbol-toolbar {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 8px;
}

.symbol-toolbar button {
    padding: 6px 12px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 6px;
    font-family: 'Iran', Tahoma, sans-serif;
    transition: background 0.2s;
}

.symbol-toolbar button:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
}

/* استایل textarea نت */
#note-textarea {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #dadce0;
    border-radius: 8px;
    font-family: 'Iran', Tahoma, sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    resize: vertical;
    min-height: 150px;
}

#note-textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* استایل آیتم‌های پاسخ در جزئیات گزارش */
.answer-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.answer-item.correct {
    background: #e8f5e9;
    border-left: 4px solid #0f9d58;
}

.answer-item.wrong {
    background: #ffebee;
    border-left: 4px solid #d93025;
}

.answer-item.unanswered {
    background: #f5f5f5;
    border-left: 4px solid #999;
}

.answer-item p {
    margin-bottom: 4px;
    font-size: 0.9rem;
}
/* ========== اضافه شدن به css/style.css ========== */

/* پلن‌های اشتراک */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}
@media (min-width: 600px) { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .plans-grid { grid-template-columns: repeat(4, 1fr); } }

.plan-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}
.plan-card:hover { transform: translateY(-3px); }
.plan-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.plan-duration { font-size: 0.9rem; color: #888; }
.plan-price { font-size: 1.5rem; font-weight: bold; margin: 12px 0; color: #202124; }
.plan-features { font-size: 0.85rem; color: #666; margin-bottom: 15px; line-height: 1.6; }

/* استایل تب‌ها */
.tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 20px; }
.tab-btn { padding: 10px 18px; border: none; border-radius: 8px; cursor: pointer; font-family: 'Iran', Tahoma, sans-serif; font-size: 0.9rem; background: #e0e0e0; color: #333; transition: background 0.2s; }
.tab-btn.active, .tab-btn:hover { background: #1a73e8; color: #fff; }

/* لندینگ پیج */
.landing-hero {
    background: linear-gradient(135deg, #e8f0fe 0%, #f5f5f5 100%);
    padding: 80px 20px;
    border-radius: 0 0 50px 50px;
}
.landing-title { font-size: 2.5rem; margin-bottom: 15px; }
.landing-subtitle { font-size: 1.2rem; color: #666; }
.btn-lg { padding: 15px 30px !important; font-size: 1.1rem !important; }
@media (max-width: 600px) {
    .landing-title { font-size: 1.8rem; }
    .landing-hero { padding: 50px 15px; }
}

/* نشانگر وضعیت اشتراک */
.subscription-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}
.subscription-badge.active { background: #e8f5e9; color: #0f9d58; }
.subscription-badge.expired { background: #fff3e0; color: #f9ab00; }
.subscription-badge.cancelled { background: #ffebee; color: #d93025; }

/* کلاس‌های کمکی اضافی */
.justify-center { justify-content: center; }
.btn-block { display: block; width: 100%; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 40px; }
.mb-4 { margin-bottom: 32px; }