/* لود فونت به صورت کاملاً آفلاین */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-main: #0f172a; --bg-card: #1e293b; --text-main: #f8fafc; --text-muted: #94a3b8;
    --primary: #8b5cf6; --secondary: #334155; --accent: #0ea5e9; --success: #10b981; --danger: #ef4444;
    --border-radius: 12px; --border-color: rgba(255,255,255,0.05); --input-bg: #0f172a;
}
[data-theme="light"] {
    --bg-main: #f1f5f9; --bg-card: #ffffff; --text-main: #0f172a; --text-muted: #64748b;
    --primary: #6d28d9; --secondary: #cbd5e1; --accent: #0284c7; --success: #059669; --danger: #dc2626;
    --border-color: rgba(0,0,0,0.1); --input-bg: #f8fafc;
}

/* 🔴 حل مشکل فونت دکمه‌ها و فیلدها */
* { box-sizing: border-box; font-family: 'Vazirmatn', sans-serif; outline: none; }
button, input, select, textarea { font-family: inherit !important; }
body { background-color: var(--bg-main); color: var(--text-main); margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; transition: background 0.3s; }

/* هدر */
.app-header { background: var(--bg-card); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.1);}
.app-header h1 { font-size: 1.1rem; margin: 0; font-weight: bold; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn { background: transparent; border: none; color: var(--text-main); cursor: pointer; padding: 5px; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }

/* فرم‌ها و کارت‌ها */
.view-section { padding: 15px; animation: fadeIn 0.3s; }
.form-container { max-width: 450px; margin: 0 auto; }
.card { background-color: var(--bg-card); border-radius: var(--border-radius); padding: 20px; margin-bottom: 15px; border: 1px solid var(--border-color); box-shadow: 0 4px 6px rgba(0,0,0,0.05);}
.card h2 { margin-top: 0; font-size: 1.1rem; margin-bottom: 15px; }

/* ورودی‌ها و دکمه‌ها */
input, textarea { width: 100%; padding: 12px; margin-bottom: 12px; background-color: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 8px; font-size: 0.95rem; }
input:focus, textarea:focus { border-color: var(--primary); }
.checkbox-label { display: flex; align-items: center; justify-content: flex-start; gap: 8px; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; }
.checkbox-label input { width: auto; margin: 0; }

/* استایل اصلی دکمه‌ها */
.btn { padding: 12px; border: none; border-radius: 8px; font-size: 0.95rem; cursor: pointer; width: 100%; color: white; transition: 0.2s; margin-bottom: 10px;}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #6d28d9); }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); }
.btn-secondary { background-color: var(--secondary); color: #000; }
[data-theme="dark"] .btn-secondary { color: white; }
.btn-small { width: auto; padding: 6px 12px; font-size: 0.85rem; }

/* دراپ‌داون‌ها */
.custom-select-wrapper { position: relative; width: 100%; margin-bottom: 12px; }
.custom-select { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; background-color: var(--input-bg); border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 15px; color: var(--text-main); cursor: pointer; font-size: 0.95rem;}
.select-text { flex: 1; text-align: right; padding-right: 5px; }
.custom-options { position: absolute; top: 100%; left: 0; right: 0; background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.5); margin-top: 4px; z-index: 1000; max-height: 180px; overflow-y: auto; display: none; flex-direction: column; }
.custom-options.open { display: flex; }
.custom-option { padding: 10px 15px; cursor: pointer; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; text-align: right;}
.custom-option:hover { background-color: rgba(139, 92, 246, 0.1); }

/* درختواره پروژه‌ها */
.project-group { margin-bottom: 15px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-color); background: var(--bg-card);}
.project-header { background: rgba(139, 92, 246, 0.05); padding: 12px 15px; font-size: 1rem; font-weight: bold; color: var(--primary); cursor: pointer; display: flex; justify-content: space-between; align-items: center;}
.project-tasks-container { padding: 10px; }
.project-tasks-container.collapsed { display: none; }
.task-card { background: var(--input-bg); border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: pointer; border: 1px solid transparent; }
.task-card:hover { border-color: var(--primary); }
.task-card h3 { margin: 5px 0; font-size: 1rem; }
.tag { background: rgba(139, 92, 246, 0.2); color: var(--primary); padding: 3px 8px; border-radius: 6px; font-size: 0.75rem; display: inline-block; }

/* دکمه شناور */
.fab { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #6d28d9); color: white; border: none; box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4); cursor: pointer; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 0; transition: transform 0.2s;}
.fab:active { transform: translateX(-50%) scale(0.95); }
.fab svg { display: block; }

/* مودال‌ها */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(3px); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 15px; opacity: 0; visibility: hidden; transition: 0.3s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { width: 100%; max-width: 450px; max-height: 90vh; overflow-y: auto; transform: scale(0.95); transition: 0.3s; background: var(--bg-main); padding: 20px; border-radius: 12px;}
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-content.large-modal { max-width: 800px; }
.modal-tabs { display: flex; width: 100%; background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 5px; margin-bottom: 15px; }
.tab-btn { flex: 1; padding: 10px; border: none; background: transparent; color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: 0.95rem; transition: 0.3s; }
.tab-btn.active { background: var(--primary); color: white; }

/* 🔴 استایل‌های جدید برای باکس چت و عکس‌ها */
.section-title { font-size: 1rem; color: var(--primary); border-bottom: 1px solid var(--border-color); padding-bottom: 5px; margin-bottom: 10px; margin-top: 20px; }

.chat-section-wrapper {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
}

.report-item, .chat-bubble { padding: 10px 12px; border-radius: 8px; margin-bottom: 10px; font-size: 0.9rem; background: var(--input-bg); border: 1px solid var(--border-color); }
.report-item { border-right: 4px solid var(--success); }
.chat-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; justify-content: space-between; margin-bottom: 5px; }
.clickable-image { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--border-color); margin-top: 5px; }

/* دکمه حذف عکس */
.remove-attachment-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.image-viewer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 9999; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: 0.3s; }
.image-viewer.active { opacity: 1; visibility: visible; }
.image-viewer img { max-width: 95%; max-height: 95%; border-radius: 8px; }
.close-viewer { position: absolute; top: 20px; right: 20px; color: white; font-size: 2rem; cursor: pointer; }

#toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; width: 90%; max-width: 350px; }
.custom-toast { background: var(--bg-card); padding: 12px 15px; border-radius: 8px; border-right: 4px solid var(--success); font-size: 0.9rem; animation: slideUp 0.3s forwards; color: var(--text-main); box-shadow: 0 4px 10px rgba(0,0,0,0.2);}
.custom-toast.error { border-right-color: var(--danger); }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut { to { opacity: 0; } }
