@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;800;900&display=swap');

:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --primary-hover: #4f46e5;
  --bg-gradient: radial-gradient(circle at 15% 15%, #2e1065 0%, #0f172a 45%, #020617 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-light: rgba(255, 255, 255, 0.22);
  --glass-shadow: 0 12px 36px 0 rgba(0, 0, 0, 0.45);
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.35);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --star-gold: #fbbf24;
  --star-glow: rgba(251, 191, 36, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, Tahoma, sans-serif;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
  padding-bottom: 95px !important;
  overflow-x: hidden;
}

/* اسکرول‌بار مخفی و مدرن */
::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
}

/* کارت شیشه‌ای اصلی */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

/* کارت امتیاز ستاره‌ها */
.star-counter {
  text-align: center;
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.15) 0%, rgba(255, 255, 255, 0.03) 75%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 24px 16px;
}

.star-counter .count {
  font-size: 3.8rem;
  font-weight: 900;
  color: var(--star-gold);
  text-shadow: 0 0 30px var(--star-glow);
  margin-top: 6px;
  letter-spacing: -1px;
}

/* ورودی‌ها و کنترل‌های فرم */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 10px;
  margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text-main);
  outline: none;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  background: rgba(15, 23, 42, 0.8);
}

/* دکمه‌ها */
button {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: all 0.2s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

button.btn-success {
  background: var(--success);
  box-shadow: 0 4px 16px var(--success-glow);
}

button.btn-danger {
  background: var(--danger);
  box-shadow: 0 4px 16px var(--danger-glow);
}

/* آیتم‌های لیست تسک و تاریخچه */
.task-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* برچسب‌ها (Badges) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* تب‌ها */
.tab-content {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-content.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* نوار ناوبری پایین صفحه (Bottom Navigation) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding: 0 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: none;
  width: auto;
  padding: 6px 12px;
  gap: 4px;
  box-shadow: none;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.2s, color 0.2s;
}

.nav-item.active {
  color: var(--star-gold);
}

.nav-item.active svg {
  transform: translateY(-2px) scale(1.1);
  filter: drop-shadow(0 0 8px var(--star-glow));
}

footer {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  transition: opacity 0.3s ease;
}

footer:hover {
  background: rgba(255, 255, 255, 0.04);
}

.child-tab-content {
  display: none;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  animation: fadeIn 0.25s ease-in-out;
}

.child-tab-content.active {
  display: flex;
}