/* style.css - نسخه با فونت دانا (Dana) */

/* ------------------------------------------------------- */
/* 1. تعریف فونت دانا (Dana)                              */
/* ------------------------------------------------------- */

/* وزن معمولی (Regular - 400) */
@font-face {
    font-family: 'Dana';
    src: url('fonts/Dana-Regular.woff2') format('woff2'),
         url('fonts/Dana-Regular.woff') format('woff'),
         url('fonts/Dana-Regular.ttf') format('truetype');
    font-weight: 400;
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* وزن نیمه‌ضخیم (DemiBold/Medium - 600) - برای دکمه‌ها */
@font-face {
    font-family: 'Dana';
    src: url('fonts/Dana-DemiBold.woff2') format('woff2'),
         url('fonts/Dana-DemiBold.woff') format('woff'),
         url('fonts/Dana-DemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* وزن ضخیم (Bold - 700) - برای تیترها */
@font-face {
    font-family: 'Dana';
    src: url('fonts/Dana-Bold.woff2') format('woff2'),
         url('fonts/Dana-Bold.woff') format('woff'),
         url('fonts/Dana-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* وزن خیلی ضخیم (ExtraBold - 800) - برای تاکیدهای خاص */
@font-face {
    font-family: 'Dana';
    src: url('fonts/Dana-ExtraBold.woff2') format('woff2'),
         url('fonts/Dana-ExtraBold.woff') format('woff'),
         url('fonts/Dana-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------------------------------- */
/* 2. اعمال فونت دانا روی کل سایت                         */
/* ------------------------------------------------------- */

:root {
    --bg-color: #f5f3ff;
    --primary: #8b5cf6;
    /* ... بقیه متغیرها ... */
}

/* ریست و فونت پایه */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}




/* ------------------------------------------------------- */
/* 2. متغیرها و استایل‌های اصلی                           */
/* ------------------------------------------------------- */

:root {
    --bg-color: #f5f3ff;
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --surface: #ffffff;
    --text-dark: #4c1d95;
    --text-gray: #6b7280;
    --border: #e5e7eb;
    --radius: 16px;
    --shadow: 0 15px 30px -5px rgba(139, 92, 246, 0.15);
    
    /* رنگ‌های وضعیت */
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    
    /* رنگ‌های هشدار (جدید) */
    --warning-bg: #fffbeb;
    --warning-text: #b45309;
    --warning-border: #f59e0b;
}

/* 3. Reset & Fonts Basic */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* *** تغییر مهم: اینجا نام فونت به Dana تغییر کرد *** */
body, input, select, textarea, button, label, p, span, div, a, h1, h2, h3, h4, h5, h6 {
    font-family: 'Dana', 'Vazirmatn', sans-serif !important;
}


body {
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-dark);
    position: relative;
    line-height: 1.6;
}

/* --- Top Navigation --- */
.top-nav {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;
}

.back-link {
    text-decoration: none;
    background-color: #ffffff;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 15px;
    border-radius: 50px;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.back-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.25);
    background-color: var(--primary);
    color: #fff;
}

/* --- Main Card --- */
.main-card {
    background: var(--surface);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #fff;
    position: relative;
    margin-top: 60px; /* فضای خالی برای لوگو */
}

/* --- Logo --- */
.brand-logo-container {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 110px;
    background: #fff;
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 4px solid var(--bg-color);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* --- Tabs --- */
.tabs-header {
    background: #faf5ff;
    padding: 60px 10px 10px;
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #f3e8ff;
    border-radius: var(--radius) var(--radius) 0 0;
}

.tab-btn {
    flex: 1;
    padding: 10px 5px;
    border: none;
    background: transparent;
    color: var(--text-gray);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* --- Content & Forms --- */
.content-area {
    padding: 25px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-box {
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    line-height: 1.8;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.alert-warning { background: #fff7ed; color: #9a3412; border: 1px solid #ffedd5; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #dbeafe; }

.divider {
    display: flex;
    align-items: center;
    margin: 25px 0 15px 0;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.divider::after {
    content: ''; flex: 1; height: 1px; background: #e9d5ff; margin-right: 10px;
}

.form-row { display: flex; gap: 15px; margin-bottom: 15px; }
.col-half { flex: 1; }
.form-group { margin-bottom: 18px; position: relative; }

label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-dark); }
.required { color: #ef4444; }

.input-icon-wrap { position: relative; }
.input-icon-wrap i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #a78bfa; font-size: 1rem; }

input, select, textarea {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    background: #fff;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ltr-input input { 
    direction: ltr; 
    text-align: left; /* تغییر به چپ چین برای اعداد */
    padding-left: 12px; 
    padding-right: 40px; 
    font-family: monospace, 'Vazirmatn' !important; 
    font-weight: 600; 
}

/* --- Image Upload --- */
.file-upload-label { 
    display: block;
    border: 2px dashed #d8b4fe; 
    border-radius: 12px; 
    padding: 25px 15px; 
    text-align: center; 
    cursor: pointer; 
    transition: 0.3s; 
    background: #faf5ff; 
    position: relative;
    width: 100%;
}
.file-upload-label:hover { border-color: var(--primary); background: #f3e8ff; }
.hidden-file-input { position: absolute; width: 0.1px; height: 0.1px; opacity: 0; overflow: hidden; z-index: -1; }
.upload-icon { font-size: 2rem; color: var(--primary); margin-bottom: 10px; display: block; }
.upload-text { font-size: 0.85rem; color: var(--text-gray); display: block; }

.file-preview { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 10px; 
    margin-top: 20px; 
    width: 100%;
}

.preview-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    animation: popIn 0.3s ease;
}

.preview-img { 
    width: 100%; 
    height: 100%; 
    border-radius: 12px; 
    object-fit: cover; 
    border: 1px solid #e5e7eb; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05); 
    transition: transform 0.2s, border-color 0.2s;
    background: #fff;
    display: block;
    cursor: zoom-in;
}
.preview-img:hover { transform: scale(1.03); border-color: var(--primary); }

.delete-btn {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: 0.2s;
    z-index: 2;
}
.delete-btn:hover { background: #dc2626; transform: scale(1.1); }

@keyframes popIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

/* --- AI Loading Overlay --- */
.loading-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 5000;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.loading-overlay.visible { opacity: 1; visibility: visible; }

.loading-content {
    background: white; padding: 30px; border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    text-align: center; width: 300px;
}

.ai-pulse-ring {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--primary); position: relative; margin: 0 auto 25px;
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
    animation: pulse-ring 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
    display: flex; align-items: center; justify-content: center; color: white; font-size: 1.5rem;
}
@keyframes pulse-ring { to { box-shadow: 0 0 0 20px rgba(139, 92, 246, 0); } }

.loading-text {
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.progress-steps { text-align: right; margin-top: 15px; }
.step {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; color: var(--text-gray); margin-bottom: 8px;
    opacity: 0.5; transition: 0.3s;
}
.step.active { opacity: 1; color: var(--primary-dark); font-weight: 700; transform: translateX(-5px); }
.step.completed { opacity: 1; color: #16a34a; }

/* --- Toast --- */
.toast-error { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #fee2e2; color: #991b1b; padding: 12px 25px; border-radius: 50px; box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3); z-index: 3000; font-weight: 700; font-size: 0.9rem; border: 1px solid #fecaca; display: flex; align-items: center; gap: 10px; opacity: 0; visibility: hidden; transition: 0.3s; }
.toast-error.show { opacity: 1; visibility: visible; top: 30px; }

/* --- Footer & Buttons --- */
.btn-submit { width: 100%; padding: 14px; background: var(--primary); color: #fff; border: none; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; transition: 0.3s; margin-top: 10px; }
.btn-submit:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }

.footer-actions { background: #faf5ff; border-top: 1px solid #f3e8ff; padding: 20px 25px; display: flex; flex-direction: column; gap: 15px; }
.quick-links { display: flex; gap: 10px; }
.btn-link { flex: 1; text-align: center; text-decoration: none; padding: 12px; border-radius: 10px; font-size: 0.9rem; font-weight: 600; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-track { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-track:hover { background: var(--primary); color: #fff; }
.btn-factor { background: #fff; color: var(--text-dark); border: 1px solid #d1d5db; }
.btn-factor:hover { background: #f3f4f6; border-color: #9ca3af; }
.support-info { text-align: center; font-size: 0.9rem; color: var(--text-gray); font-weight: 500; display: flex; justify-content: center; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid #f3e8ff; }
.support-phone { color: var(--text-dark); font-weight: 700; text-decoration: none; direction: ltr; }
.whatsapp-icon { color: #25D366; font-size: 1.2rem; }

/* --- Switch --- */
.toggle-wrapper { background: #fdf4ff; border: 1px solid #fae8ff; padding: 12px 15px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.toggle-label { font-size: 0.9rem; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.switch { position: relative; display: inline-block; width: 50px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(24px); }
.hidden-section { display: none; }
.fade-in-section { animation: fadeInSection 0.5s ease; }

/* --- Modals (General) --- */
.modal-overlay, .image-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-overlay { background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(5px); z-index: 2000; }
.image-modal-overlay { background: rgba(0, 0, 0, 0.9); backdrop-filter: blur(8px); z-index: 4000; padding: 20px; }
.modal-overlay.open, .image-modal-overlay.open { opacity: 1; visibility: visible; }

.modal-card { background: white; width: 90%; max-width: 400px; border-radius: 20px; padding: 30px; text-align: center; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); transform: scale(0.8); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; }
.modal-overlay.open .modal-card { transform: scale(1); }

/* --- Warning Modal Specifics (NEW) --- */
#warningModal .modal-card { border-top: 5px solid var(--warning-border); }
#warningModal .success-animation { background: var(--warning-bg); color: var(--warning-text); border: 2px solid var(--warning-border); }
#warningModal .modal-title { color: var(--warning-text); }

/* --- Image Modal --- */
.image-modal-content { position: relative; max-width: 90%; max-height: 90%; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3); transform: scale(0.9); transition: all 0.3s ease; }
.image-modal-overlay.open .image-modal-content { transform: scale(1); }
.image-modal-img { width: 100%; height: auto; display: block; max-height: 85vh; object-fit: contain; }
.image-modal-close { position: absolute; top: 15px; right: 15px; background: rgba(255, 255, 255, 0.2); color: white; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; transition: 0.2s; border: none; }
.image-modal-close:hover { background: rgba(255, 255, 255, 0.4); }

/* --- Result Icons & Lists --- */
.success-animation { margin: 0 auto 20px; width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; }
.success-bg { background: var(--success-bg); color: var(--success-text); }
.error-bg { background: var(--error-bg); color: var(--error-text); border: 2px solid #fecaca; }
.success-animation i { font-size: 2.5rem; }

.modal-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; color: var(--text-dark); }
.modal-subtitle { font-size: 0.85rem; color: #d97706; background: #fffbeb; padding: 10px; border-radius: 8px; margin-bottom: 15px; line-height: 1.6; border: 1px solid #fef3c7; }
.modal-subtitle.error-mode { color: #991b1b; background: #fef2f2; border-color: #fee2e2; }

.data-list { list-style: none; margin: 20px 0; padding: 0; background: #f9fafb; border-radius: 12px; overflow: hidden; }
.data-list li { display: flex; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid #e5e7eb; font-size: 0.9rem; }
.data-list li:last-child { border-bottom: none; }
.data-list span.label { color: var(--text-gray); }
.data-list span.value { font-weight: 700; color: var(--text-dark); direction: ltr; }

.btn-modal { background: var(--text-dark); color: white; border: none; padding: 12px 30px; border-radius: 10px; cursor: pointer; font-size: 1rem; width: 100%; transition: 0.2s; }
.btn-modal:hover { opacity: 0.9; transform: translateY(-2px); }

/* --- Responsive --- */
@media (max-width: 480px) { 
    .form-row { flex-direction: column; gap: 0; } 
    .content-area { padding: 15px; } 
    .brand-logo-container { width: 90px; height: 90px; top: -50px; } 
    .quick-links { flex-direction: column; } 
    .top-nav { right: 10px; top: 10px; }
    .file-preview { grid-template-columns: repeat(2, 1fr); } 
}