@font-face {
    font-family: vazir;
    src: url('Vazirmatn-font-face.css');
}

:root {
    --bg-light: #eef2f6;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --primary: #2563eb;
    /* آبی پررنگ‌تر و جذاب‌تر */
    --primary-hover: #1d4ed8;
    --danger: #ef4444;
    /* قرمز واضح‌تر */
    --danger-hover: #dc2626;
    --success: #10b981;
    /* سبز زیبا */
    --glass-bg: rgba(255, 255, 255, 0.75);
    /* کمی مات‌تر برای وضوح بیشتر نوشته‌ها */
    --glass-border: rgba(255, 255, 255, 0.9);
    --radius-lg: 20px;
    --radius-md: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: vazir;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px 15px;
    position: relative;
    /* حل مشکل باگ‌های اسکرول افقی در موبایل */
    overflow-x: hidden;
}

.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    z-index: -1;
    opacity: 0.5;
}

.shape-1 {
    width: 350px;
    height: 350px;
    background: #93c5fd;
    top: -50px;
    right: -50px;
}

.shape-2 {
    width: 450px;
    height: 450px;
    background: #c4b5fd;
    bottom: -100px;
    left: -100px;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.06);
}

.glass-inner {
    background: rgba(255, 255, 255, 0.85);
    /* پس زمینه سفیدتر برای خوانایی کامل */
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.app-wrapper {
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-radius: var(--radius-lg);
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: bold;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary);
    color: white;
}

.content-area {
    padding: 30px;
    border-radius: var(--radius-lg);
    min-height: 500px;
}

.view-section {
    animation: fadeIn 0.3s ease;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* باکس هشدار آفلاین */
.offline-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #ecfdf5;
    border-right: 5px solid var(--success);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
}

.offline-alert .alert-icon {
    font-size: 2rem;
}

.offline-alert .alert-text p {
    font-size: 0.85rem;
    color: #047857;
    margin-top: 5px;
}

.offline-alert .alert-text strong {
    color: #065f46;
}

.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.app-header h1 {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.app-header p {
    color: var(--text-muted);
}

.drop-zone {
    border: 2px dashed #94a3b8;
    text-align: center;
    position: relative;
    transition: 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.drop-zone input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone .icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.btn-mock {
    padding: 8px 24px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-weight: bold;
    margin-top: 10px;
    pointer-events: none;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-dark);
}

/* دکمه‌ها */
.btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    border: none;
    text-align: center;
    display: block;
    text-decoration: none;
}

.btn-small {
    width: auto;
    padding: 10px 20px;
    font-size: 0.9rem;
}

.primary-btn {
    background: var(--primary);
    color: white;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.primary-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.primary-btn:disabled {
    background: #cbd5e1;
    color: #64748b;
    box-shadow: none;
    cursor: not-allowed;
}

.danger-btn {
    background: var(--danger);
    color: white;
}

.danger-btn:hover {
    background: var(--danger-hover);
}

.outline-btn {
    background: white;
    border: 2px solid #e2e8f0;
    color: var(--text-dark);
}

.outline-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.add-more-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #cbd5e1;
    text-align: center;
}

/* هشدارها و نوار پیشرفت */
.error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-weight: bold;
}

.progress-container {
    margin: 20px 0;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.3s ease;
}

.auto-ram-badge {
    background: #eff6ff;
    color: #1e3a8a;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 15px;
    text-align: center;
    font-weight: bold;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.setting-card h3,
.help-card h4 {
    margin-bottom: 12px;
    color: var(--primary);
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    font-weight: bold;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* --- موبایل --- */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: 90px;
    }

    .app-wrapper {
        max-width: 100%;
    }

    .navbar {
        display: none;
    }

    .content-area {
        padding: 20px;
    }

    .bottom-nav {
        display: block;
        position: fixed;
        bottom: 10px;
        left: 5%;
        width: 90%;
        border-radius: 20px;
        z-index: 1000;
        padding: 10px;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    }

    .nav-links-mobile {
        display: flex;
        justify-content: space-around;
        list-style: none;
    }

    .nav-links-mobile a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 0.75rem;
        transition: 0.3s;
        padding: 5px;
        font-weight: bold;
    }

    .nav-links-mobile a.active {
        color: var(--primary);
    }

    .nav-icon {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }

    .offline-alert {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}