/* Component Styles */

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary-600, var(--primary-800));
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}
.btn-primary:hover {
  background: var(--primary-500, var(--primary-700));
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.btn-outline {
  background: transparent;
  color: var(--primary-600);
  border-color: var(--primary-600);
}
[data-theme="dark"] .btn-outline {
  color: var(--primary-400);
  border-color: var(--primary-400);
}
.btn-outline:hover {
  background: var(--primary-50);
}
[data-theme="dark"] .btn-outline:hover {
  background: rgba(16, 185, 129, 0.1);
}

.btn-gold {
  background: var(--gold-500, var(--gold-700));
  color: #0F172A;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.25);
}
.btn-gold:hover {
  background: var(--gold-400, var(--gold-600));
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}
.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  padding: 0.625rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.btn-theme-toggle:hover {
  background: var(--bg-surface-hover);
  border-color: var(--primary-500);
  color: var(--primary-600);
  transform: translateY(-1px);
}

/* ================= Cards ================= */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-500);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
}

/* ================= Badges ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  line-height: 1;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}
.badge-success .badge-dot { background: var(--success); }

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.badge-warning .badge-dot { background: var(--warning); }

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-danger .badge-dot { background: var(--danger); }

.badge-info {
  background: var(--info-bg);
  color: var(--info);
}
.badge-info .badge-dot { background: var(--info); }

.badge-neutral {
  background: var(--bg-alt);
  color: var(--text-secondary);
}
.badge-neutral .badge-dot { background: var(--text-muted); }

/* ================= Countdown Component ================= */
.countdown-card {
  background: var(--bg-surface, var(--bg-alt));
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.countdown-card.status-overdue {
  border-color: var(--danger);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.countdown-card.status-due-soon {
  border-color: var(--warning);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.countdown-card.status-upcoming {
  border-color: var(--primary-500);
}

.countdown-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
}

.countdown-unit {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  min-width: 72px;
  box-shadow: var(--shadow-sm);
}

.countdown-val {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-english);
  color: var(--primary-600);
  line-height: 1.1;
}
[data-theme="dark"] .countdown-val {
  color: var(--primary-400);
}
.status-overdue .countdown-val { color: var(--danger); }
.status-due-soon .countdown-val { color: var(--warning); }

.countdown-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ================= Stat Cards ================= */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--primary-50);
  color: var(--primary-600);
}
[data-theme="dark"] .stat-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-400);
}
.stat-icon.warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.stat-icon.danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.stat-icon.info {
  background: var(--info-bg);
  color: var(--info);
}

.stat-value {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ================= Form Controls ================= */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.95rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-helper {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ================= Step Indicator ================= */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0 0.5rem;
}

.step-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.step-item.active .step-bubble {
  border-color: var(--primary-600);
  background: var(--primary-600);
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.step-item.completed .step-bubble {
  border-color: var(--primary-600);
  background: var(--primary-50);
  color: var(--primary-600);
}
[data-theme="dark"] .step-item.completed .step-bubble {
  background: rgba(16, 185, 129, 0.2);
  color: var(--primary-400);
}

.step-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.step-item.active .step-title {
  color: var(--primary-600);
}
[data-theme="dark"] .step-item.active .step-title {
  color: var(--primary-400);
}

/* ================= Tables ================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  text-align: start;
}

.data-table th {
  background: var(--bg-alt);
  padding: 0.875rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

/* ================= Modals ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* ================= Toast Notifications ================= */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  inset-inline-end: 1.5rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  animation: fadeIn 0.3s ease forwards;
  min-width: 280px;
}

.toast.toast-success { border-inline-start: 4px solid var(--success); }
.toast.toast-error { border-inline-start: 4px solid var(--danger); }
.toast.toast-info { border-inline-start: 4px solid var(--info); }
.toast.toast-warning { border-inline-start: 4px solid var(--warning); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-state-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
