/* style.css — استایل پایه AftabPanel (با پشتیبانی تم پویا و فونت Vazir) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================================================================
 * فونت Vazir — وزن‌های مختلف + نسخه FD (با اعداد فارسی)
 * توجه: مسیرها نسبت به ریشه سایت (absolute from web root) تعریف شده‌اند
 * تا در همه صفحات (چه در ریشه، چه در ساب‌دایرکتوری) درست لود شوند.
 * اگر پروژه را در ساب‌دایرکتوری deploy می‌کنید، BASE_PATH را در config.php
 * تعریف کرده و از PHP برای تولید مسیر استفاده کنید.
 * ========================================================================= */
@font-face {
  font-family: "Vazir";
  src: url("./assets/fonts/Vazir.woff2") format("woff2"),
       url("./assets/fonts/Vazir.woff") format("woff"),
       url("./assets/fonts/Vazir.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir";
  src: url("./assets/fonts/Vazir-Light.woff2") format("woff2"),
       url("./assets/fonts/Vazir-Light.woff") format("woff"),
       url("./assets/fonts/Vazir-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir";
  src: url("./assets/fonts/Vazir-Medium.woff2") format("woff2"),
       url("./assets/fonts/Vazir-Medium.woff") format("woff"),
       url("./assets/fonts/Vazir-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir";
  src: url("./assets/fonts/Vazir-Bold.woff2") format("woff2"),
       url("./assets/fonts/Vazir-Bold.woff") format("woff"),
       url("./assets/fonts/Vazir-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir";
  src: url("./assets/fonts/Vazir-Thin.woff2") format("woff2"),
       url("./assets/fonts/Vazir-Thin.woff") format("woff"),
       url("./assets/fonts/Vazir-Thin.ttf") format("truetype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

/* نسخه با اعداد فارسی (FD = Farsi Digits) */
@font-face {
  font-family: "Vazir-FD";
  src: url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-FD-WOL.woff2") format("woff2"),
       url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-FD-WOL.woff") format("woff"),
       url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-FD-WOL.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir-FD";
  src: url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Medium-FD-WOL.woff2") format("woff2"),
       url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Medium-FD-WOL.woff") format("woff"),
       url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Medium-FD-WOL.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir-FD";
  src: url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Bold-FD-WOL.woff2") format("woff2"),
       url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Bold-FD-WOL.woff") format("woff"),
       url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Bold-FD-WOL.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazir-FD";
  src: url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Light-FD-WOL.woff2") format("woff2"),
       url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Light-FD-WOL.woff") format("woff"),
       url("./assets/fonts/Farsi-Digits-Without-Latin/Vazir-Light-FD-WOL.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* =========================================================================
 * تم پیش‌فرض (Aurora) — متغیرهای CSS که از theme.php بازنویسی می‌شوند
 * ========================================================================= */
:root {
  --bg:           #F8F8FB;
  --bg-elevated:  #FFFFFF;
  --bg-soft:      #F0F0F5;
  --surface:      #FFFFFF;
  --surface-hover:#FAFAFC;
  --text:         #1A1A2E;
  --text-muted:   #6B6B7B;
  --text-faint:   #A0A0B0;
  --border:       #EDEDF2;
  --border-soft:  #F4F4F8;
  --accent:       #6366F1;
  --accent-hover: #4F46E5;
  --accent-soft:  #EEF0FF;
  --accent-text:  #FFFFFF;
  --success:      #10B981;
  --success-soft: #ECFDF5;
  --warning:      #F59E0B;
  --warning-soft: #FFFBEB;
  --danger:       #EF4444;
  --danger-soft:  #FEF2F2;
  --info:         #3B82F6;
  --info-soft:    #EFF6FF;
  --shadow-soft:  0 1px 3px rgba(99,102,241,0.04);
  --shadow-md:    0 4px 12px rgba(99,102,241,0.06);
  --is-dark:      0;

  /* متغیرهای قدیمی برای سازگاری معکوس */
  --black: #0a0a0a;
  --dark-gray: #1a1a1a;
  --blue: var(--accent);
  --blue-dark: var(--accent-hover);
  --yellow: var(--accent);
  --yellow-dark: var(--accent-hover);
  --white: var(--bg-elevated);

  /* اندازه‌های استاندارد */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;
  --font-base: "Vazir-FD", "Vazir", "Segoe UI", system-ui, sans-serif;
  --font-num: "Vazir-FD", "Vazir", system-ui, sans-serif;
}

body {
  font-family: var(--font-base);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* برای اعداد، از نسخه فارسی فونت استفاده کنیم */
.num, .stat-number, .price-display, [data-num] {
  font-family: var(--font-num);
  font-feature-settings: "tnum";
}

/* ===== صفحات لاگین ===== */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.login-container {
  width: 100%;
  padding: 20px;
}

.login-card {
  background: var(--dark-gray);
  border-radius: 20px;
  padding: 40px 30px;
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 10px 40px var(--shadow-md);
  border: 1px solid var(--blue);
}

.login-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.login-card h2 {
  color: var(--yellow);
  margin-bottom: 10px;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 30px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  transition: all 0.3s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.3);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--yellow);
  color: var(--accent-text);
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-login:hover {
  background: var(--yellow-dark);
  transform: translateY(-2px);
}

.demo-info {
  margin-top: 20px;
  color: var(--text-faint);
  font-size: 12px;
}

/* ===== داشبورد ===== */
.dashboard-body {
  background: var(--black);
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--blue);
}

.dashboard-header h1 {
  color: var(--yellow);
  font-size: 24px;
}

.user-info {
  display: flex;
  gap: 15px;
  align-items: center;
  background: var(--dark-gray);
  padding: 8px 18px;
  border-radius: 30px;
}

.logout-link {
  color: var(--danger);
  text-decoration: none;
  font-weight: bold;
}

.logout-link:hover {
  color: var(--danger);
}

/* کارت‌های آمار */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--dark-gray);
  border-radius: 16px;
  padding: 25px;
  text-align: center;
  border: 1px solid var(--blue);
  transition: transform 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.stat-number {
  font-size: 32px;
  font-weight: bold;
  color: var(--yellow);
}

.stat-label {
  color: var(--text-muted);
  margin-top: 8px;
}

/* کارت خوش‌آمدگویی */
.welcome-card {
  background: linear-gradient(135deg, var(--dark-gray), #0d1f2d);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  border: 1px solid var(--blue);
}

.welcome-card h3 {
  color: var(--yellow);
  margin-bottom: 10px;
}

.quick-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn-yellow {
  background: var(--yellow);
  color: var(--accent-text);
  padding: 12px 24px;
  border: none;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-yellow:hover {
  background: var(--yellow-dark);
  transform: scale(1.05);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--yellow);
  color: var(--yellow);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-outline:hover {
  background: var(--yellow);
  color: var(--accent-text);
}

/* ===== منوی ناوبری پایین یکپارچه (تمام صفحات از nav.php استفاده می‌کنند) ===== */
.bottom-nav,
.bottom-nav-modern {
  position: fixed;
  bottom: 15px;
  left: 15px;
  right: 15px;
  background: rgba(26, 26, 26, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 12px;
  border-radius: 60px;
  border: 1px solid rgba(0, 102, 204, 0.45);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 204, 0, 0.08);
  z-index: 9999;
  margin: 0;
  box-sizing: border-box;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

.nav-item,
.nav-item-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 50px;
  transition: all 0.25s ease;
  color: #aaaaaa;
  background: transparent;
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-base);
  border: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.nav-item:hover,
.nav-item-modern:hover {
  color: var(--yellow);
  background: rgba(255, 204, 0, 0.1);
  transform: translateY(-2px);
}

.nav-item.active,
.nav-item-modern.active {
  color: var(--yellow);
  background: rgba(255, 204, 0, 0.18);
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.25);
}

.nav-item.active .nav-icon,
.nav-item.active .nav-icon-modern,
.nav-item-modern.active .nav-icon,
.nav-item-modern.active .nav-icon-modern {
  transform: scale(1.1);
}

.nav-icon,
.nav-icon-modern {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item span,
.nav-item-modern span,
.nav-label-modern {
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nav-item:active,
.nav-item-modern:active {
  transform: scale(0.94);
}

/* موبایل کوچک */
@media (max-width: 480px) {
  .bottom-nav,
  .bottom-nav-modern {
    bottom: 10px;
    left: 10px;
    right: 10px;
    padding: 8px 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 50px;
  }

  .nav-item,
  .nav-item-modern {
    padding: 6px 4px;
  }

  .nav-icon,
  .nav-icon-modern {
    font-size: 19px;
  }

  .nav-item span,
  .nav-item-modern span,
  .nav-label-modern {
    font-size: 9.5px;
  }
}

/* اطمینان از وجود فضای پایین برای محتوای صفحه */
.dashboard-container,
.page-container,
.container {
  padding-bottom: 110px;
}

/* لغو قوانین قبلی که با استایل جدید تداخل داشتند */
.nav-item-modern::before {
  display: none !important;
}

/* ===== صفحات فرم و لیست ===== */
.page-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 100px;
}

.page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.back-link {
  color: var(--yellow);
  text-decoration: none;
  font-size: 16px;
}

.page-header h1 {
  color: var(--yellow);
  font-size: 22px;
}

/* فرم */
.property-form,
.password-form {
  background: var(--dark-gray);
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--blue);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--yellow);
  font-weight: bold;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--yellow);
}

.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--yellow);
  color: var(--accent-text);
  border: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  margin-top: 20px;
}

/* فیلتر */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  flex: 1;
  padding: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
}

/* لیست املاک */
.properties-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.property-item {
  background: var(--dark-gray);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid #2a2a2a;
  transition: all 0.3s;
}

.property-item:hover {
  border-color: var(--blue);
  transform: translateX(-5px);
}

.property-icon {
  font-size: 40px;
}

.property-details {
  flex: 1;
}

.property-details h3 {
  color: var(--yellow);
  margin-bottom: 5px;
}

.price {
  color: #4caf50;
  font-weight: bold;
  margin-top: 5px;
}

.view-detail {
  background: var(--blue);
  color: var(--text);
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
}

/* مودال */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: var(--dark-gray);
  border-radius: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 25px;
  position: relative;
  border: 1px solid var(--yellow);
}

.modal-close {
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--yellow);
}

.detail-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.detail-grid p {
  padding: 8px;
  background: var(--bg-soft);
  border-radius: 8px;
}

/* پیام‌ها */
.success-msg {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  color: #4caf50;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.error-msg {
  background: rgba(255, 68, 68, 0.2);
  border: 1px solid #ff4444;
  color: #ff8888;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  padding: 50px;
  color: var(--text-faint);
}

/* پروفایل */
.profile-card {
  background: var(--dark-gray);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
}

.profile-avatar {
  font-size: 80px;
  margin-bottom: 20px;
}

.profile-info {
  text-align: right;
  margin-bottom: 30px;
}

.profile-info p {
  padding: 10px;
  border-bottom: 1px solid #2a2a2a;
}

/* ریسپانسیو */
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 15px;
  }

  .property-item {
    flex-direction: column;
    text-align: center;
  }

  .stat-card {
    padding: 15px;
  }
}
