@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-bg: #0d1b2a;
    --secondary-bg: #1b263b;
    --primary-text: #e0e1dd;
    --accent-color: #415a77;
    --highlight-color: #778da9;
    --danger-color: #e63946;
    --success-color: #4caf50;
    --glass-bg: rgba(27, 38, 59, 0.85);
    --border-glow: rgba(119, 141, 169, 0.35);
}

/* =============================================
   جلوگیری از انتخاب متن، کپی، چشمک زدن کرسر
   ============================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn';
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    scrollbar-width: none;
    cursor: default;
    caret-color: transparent;
}

/* برای فیلدهای ورودی، کرسر و انتخاب متن فعال می‌ماند */
input, textarea, select, [contenteditable] {
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    caret-color: auto;
}

/* =============================================
   ساختار اصلی
   ============================================= */
body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--primary-bg);
    color: var(--primary-text);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at 20% 10%, rgba(65, 90, 119, 0.15), transparent 45%),
                      radial-gradient(circle at 80% 90%, rgba(119, 141, 169, 0.12), transparent 45%);
}

/* =============================================
   Header & Dropdown
   ============================================= */
.app-header {
    background: linear-gradient(180deg, rgba(27, 38, 59, 0.98), rgba(13, 27, 42, 0.95));
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(119, 141, 169, 0.15);
}

.header-content {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    align-content: space-around;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: right;
}

.app-title {
    font-size: 1.15rem;
    margin-bottom: 2px;
    background: linear-gradient(90deg, #ebfaff, #e6eaff);
    -webkit-background-clip: text;
    background-clip: text;
}

.header-datetime {
    font-size: 0.8rem;
    color: var(--highlight-color);
}

/* ===== پروفایل و دراپ‌داون (نسخه مدرن) ===== */
.user-profile-dropdown {
    position: relative;
}

.profile-trigger {
    background: rgba(119, 141, 169, 0.08);
    border: 1px solid var(--border-glow);
    border-radius: 30px;
    padding: 6px 12px 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Vazirmatn', sans-serif;
    backdrop-filter: blur(6px);
}

.profile-trigger:hover, .profile-trigger.active {
    background: linear-gradient(145deg, rgba(65, 90, 119, 0.6), rgba(119, 141, 169, 0.35));
    border-color: var(--highlight-color);
    box-shadow: 0 0 15px rgba(119, 141, 169, 0.3);
    transform: translateY(-1px);
}

.avatar svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    display: block;
}

.chevron-icon {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.profile-trigger.active .chevron-icon {
    transform: rotate(180deg);
}

/* کادر دراپ‌داون */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    width: 280px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.03);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px) scale(0.97);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow: hidden;
    text-align: right;
    max-height: 70vh;
    overflow-y: auto;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-header {
    padding: 22px 18px;
    background: linear-gradient(160deg, rgba(65, 90, 119, 0.35), rgba(13, 27, 42, 0.6));
    border-bottom: 1px solid var(--border-glow);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.dropdown-header::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 100%;
    background: radial-gradient(circle, rgba(119, 141, 169, 0.25), transparent 60%);
}

.avatar-large {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent-color), var(--highlight-color));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.15);
}

.avatar-large svg {
    width: 30px;
    height: 30px;
    stroke: var(--primary-text);
    fill: none;
}

.dropdown-name {
    font-weight: bold;
    font-size: 1.15rem;
    color: var(--primary-text);
    display: block;
    margin-bottom: 14px;
}

.dropdown-info-box {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: right;
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(4px);
}

.dropdown-info {
    font-size: 0.8rem;
    color: var(--highlight-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-info::before {
    content: "•";
    color: var(--highlight-color);
    font-size: 1.2rem;
    line-height: 0.8;
}

.dropdown-actions {
    display: flex;
    flex-direction: column;
}

.dropdown-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: right;
    padding: 14px 18px;
    color: var(--primary-text);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
}

.dropdown-btn:last-child {
    border-bottom: none;
}

.dropdown-btn:hover {
    background: rgba(65, 90, 119, 0.3);
    padding-right: 22px;
}

.dropdown-btn.danger {
    color: var(--danger-color);
}

.dropdown-btn.danger:hover {
    background-color: rgba(230, 57, 70, 0.15);
}

/* =============================================
   Main & Bottom Navigation
   ============================================= */
main {
    flex-grow: 1;
    padding: 71px 15px 48px 15px;
    overflow-y: auto;
    text-align: center;
    scrollbar-width: none;
    background-color: rgba(10, 11, 34, 0.85);
}

main.locked::before {
    content: 'برای استفاده از برنامه، لطفا ابتدا وارد شوید.';
    font-size: 1.2rem;
    color: var(--highlight-color);
}

/* ناوبری پایین مدرن */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    background: linear-gradient(180deg, rgba(27, 38, 59, 0.97), rgba(13, 27, 42, 0.98));
    backdrop-filter: blur(12px);
    box-shadow: 0 -2px 15px rgba(0,0,0,0.4);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-top: 1px solid rgba(119, 141, 169, 0.15);
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
    flex-grow: 1;
    padding: 10px 0px 0px 0px;
    background: none;
    border: none;
    color: var(--highlight-color);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn span {
    font-size: 0.72rem;
    font-weight: 400;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

/* حالت فعال (برجسته و پررنگ) */
.nav-btn.active {
    color: var(--primary-text);
    background: linear-gradient(180deg, rgba(119, 141, 169, 0.15), transparent);
}

.nav-btn.active span {
    font-weight: 800;
    font-size: 0.75rem;
}

.nav-btn.active svg {
    stroke-width: 2.4;
    transform: translateY(-2px) scale(1.12);
    filter: drop-shadow(0 0 8px rgba(119, 141, 169, 0.7));
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    width: 50%;
    height: 3px;
    border-radius: 0 0 10px 10px;
    background: linear-gradient(90deg, var(--highlight-color), var(--primary-text), var(--highlight-color));
    box-shadow: 0 0 10px rgba(119, 141, 169, 0.6);
}

/* ===== دکمه شناور ثبت نقدی ===== */
.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    height: 46px;
    padding: 0 20px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--highlight-color), var(--accent-color));
    color: var(--primary-text);
    border: none;
    box-shadow: 0 6px 20px rgba(65, 90, 119, 0.5);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.fab svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
}

.fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(65, 90, 119, 0.7);
}

.fab.hidden { display: none !important; }

/* =============================================
   Modal های مدرن (شیشه‌ای)
   ============================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  width: 92%;
  max-width: 400px;
  background: linear-gradient(160deg, rgba(37, 52, 79, 0.95), rgba(13, 27, 42, 0.96));
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 37px 5px 5px 5px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  animation: modalIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(25px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* دکمه بستن قرمز بالای پاپ‌آپ */
.modal-close {
  position: absolute;
  top: 0px;
  left: 0px;
  background: #99181833;
  color: #e63946;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 20px;
  border-radius: 20px 0px 20px 0px;
  border-color: #e63946;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(230, 57, 70, 0.15);
  transform: scale(1.05);
}

/* باکس ورود */
.login-box {
  background: linear-gradient(160deg, rgba(37, 52, 79, 0.96), rgba(13, 27, 42, 0.97));
  border: 1px solid var(--border-glow);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  border-radius: 22px;
  padding: 30px 26px;
}

.login-head {
  text-align: center;
  margin-bottom: 18px;
}

.login-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-color), var(--highlight-color));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(65, 90, 119, 0.4);
  animation: float 3s ease-in-out infinite;
}

.login-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--primary-text);
  stroke-width: 2;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.login-head h3 {
  margin: 0 0 6px;
  color: var(--primary-text);
  font-size: 1.3rem;
}

.login-head p {
  font-size: 0.8rem;
  color: var(--highlight-color);
  margin: 0;
}

.modal-content h3 {
  text-align: center;
  margin-bottom: 12px;
  color: #fff;
  font-weight: bold;
}

.message {
  margin-top: 15px;
  text-align: center;
  font-weight: bold;
}
.message.success { color: var(--success-color); }
.message.error { color: var(--danger-color); }

.login-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-input,
.custom-select {
    width: 100%;
    padding: 13px 16px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--primary-text);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 6px;
    transition: all 0.3s ease;
}

.custom-select:focus, .custom-input:focus {
    outline: none;
    border-color: var(--highlight-color);
    background-color: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 3px rgba(119, 141, 169, 0.2);
}

.custom-select option {
    background-color: var(--secondary-bg);
    color: var(--primary-text);
}

/* فیلد کد تایید (شیک و مدرن) */
.code-input-wrap {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glow);
  border-radius: 14px;
  padding: 4px;
  transition: all 0.3s ease;
}

.code-input-wrap:focus-within {
  border-color: var(--highlight-color);
  box-shadow: 0 0 0 4px rgba(119, 141, 169, 0.25), 0 0 25px rgba(119, 141, 169, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.code-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--primary-text);
  font-family: 'Vazirmatn', sans-serif;
  font-size: 1.6rem;
  text-align: center;
  letter-spacing: 14px;
  font-weight: bold;
  padding: 12px;
  caret-color: var(--highlight-color);
}

.code-input:focus {
  outline: none;
}

.code-timer {
  text-align: center;
  font-size: 16px;
  color: var(--highlight-color);
  padding: 6px 0;
}

.code-timer.warning { color: var(--danger-color); }

.btn {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--accent-color), #2f4562);
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--highlight-color), var(--accent-color));
  box-shadow: 0 8px 20px rgba(119, 141, 169, 0.4);
}

.btn:active:not(:disabled) { transform: translateY(0); }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #333;
}

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#login-message {
  text-align: center;
  font-size: 13px;
  margin-top: 10px;
}

/* =============================================
   دیالوگ سفارشی
   ============================================= */
.dialog-box {
  max-width: 340px;
  text-align: center;
}

.dialog-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(65, 90, 119, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--highlight-color);
}

.dialog-box h3 {
  margin-bottom: 0.8rem;
  font-size: 1.15rem;
  color: #3ccd34;
}

.dialog-box p {
  margin-bottom: 1.2rem;
  color: var(--highlight-color);
  font-size: 0.9rem;
  line-height: 1.7;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.verify-btn {
  flex: 1;
  padding: 11px;
  margin: 20px;
  border-radius: 10px;
  border: none;
  color: #fff;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--accent-color), var(--highlight-color));
}

.verify-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(119, 141, 169, 0.4);
}

.verify-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.verify-btn.cancel {
  background: transparent;
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
}

.verify-btn.cancel:hover {
  background: rgba(230, 57, 70, 0.15);
}

/* =============================================
   صفحه چک‌لیست
   ============================================= */
.checklist-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 10px 0 20px;
}

.checklist-header {
  background: linear-gradient(145deg, rgba(65, 90, 119, 0.25), rgba(13, 27, 42, 0.5));
  border: 1px solid var(--border-glow);
  border-radius: 18px;
  padding: 26px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.checklist-title-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-color), var(--highlight-color));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(65, 90, 119, 0.4);
}

.checklist-title-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--primary-text);
}

.checklist-header h2 {
  color: var(--primary-text);
  margin-bottom: 6px;
  font-size: 1.3rem;
}

.checklist-header p {
  color: var(--highlight-color);
  font-size: 0.85rem;
  margin: 0;
}

.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(145deg, rgba(37, 52, 79, 0.8), rgba(13, 27, 42, 0.8));
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.checklist-item:hover {
  border-color: var(--highlight-color);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.checklist-item.checked {
  border-color: var(--success-color);
  box-shadow: 0 0 25px rgba(76, 175, 80, 0.2);
  background: linear-gradient(145deg, rgba(39, 74, 52, 0.6), rgba(13, 27, 42, 0.8));
}

.checklist-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 9px;
  border: 2px solid var(--border-glow);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.checkmark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.checklist-item.checked .checkmark {
  background: linear-gradient(145deg, var(--success-color), #2e7d32);
  border-color: var(--success-color);
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
}

.checklist-item.checked .checkmark svg {
  opacity: 1;
  transform: scale(1);
}

.item-label {
  flex: 1;
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--primary-text);
  text-align: right;
}

.item-state {
  font-size: 0.75rem;
  color: var(--highlight-color);
  transition: all 0.3s ease;
}

.checklist-item.checked .item-state {
  color: var(--success-color);
}

/* اسکرول‌بار سفارشی */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--highlight-color); }
