/* ============================================
   SAHABAT GINJAL — Reusable Component Styles
   ============================================ */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-green);
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary-lighter); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-ghost { background: transparent; color: var(--color-text-secondary); }
.btn-ghost:hover { background: var(--color-divider); }
.btn-danger { background: transparent; color: var(--color-danger); }

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}
.card:active { transform: scale(0.98); }
.card-elevated { box-shadow: var(--shadow-md); }
.card-bordered { border: 1.5px solid var(--color-border); box-shadow: none; }

/* --- Input Fields --- */
.input-group { display: flex; flex-direction: column; gap: var(--space-sm); }
.input-group label { font-size: 14px; font-weight: 500; }
.input-field {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 15px; color: var(--color-text-primary);
  background: var(--color-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.input-field::placeholder { color: var(--color-text-muted); }
.input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27, 122, 61, 0.12);
}
.input-with-icon { position: relative; }
.input-with-icon .input-field { padding-left: 44px; }
.input-with-icon .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--color-text-muted); pointer-events: none;
}
.input-with-icon .input-icon-right {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--color-text-muted); cursor: pointer;
}

/* --- Search Bar --- */
.search-bar { position: relative; width: 100%; }
.search-bar input {
  width: 100%; padding: 12px 16px 12px 44px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 14px; background: var(--color-surface);
  transition: border-color var(--transition-fast);
}
.search-bar input::placeholder { color: var(--color-text-muted); }
.search-bar input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(27,122,61,0.1); }
.search-bar .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--color-text-muted); pointer-events: none;
}

/* --- Chips --- */
.chip-group {
  display: flex; gap: var(--space-sm); overflow-x: auto;
  padding-bottom: var(--space-xs); scrollbar-width: none;
}
.chip-group::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; padding: 8px 16px;
  border-radius: var(--radius-full); font-size: 13px; font-weight: 500;
  white-space: nowrap; border: 1.5px solid var(--color-border);
  color: var(--color-text-secondary); background: var(--color-surface);
  transition: all var(--transition-fast); cursor: pointer;
}
.chip:active { transform: scale(0.95); }
.chip.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* --- Badge --- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 600;
}
.badge-green { background: var(--color-primary-lighter); color: var(--color-primary); }
.badge-red { background: #FDECEA; color: var(--color-accent-red); }
.badge-orange { background: #FFF3E0; color: var(--color-accent-orange); }
.badge-blue { background: #E3F2FD; color: var(--color-accent-blue); }

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--max-width);
  background: var(--color-surface); border-top: 1px solid var(--color-border);
  display: flex; align-items: flex-end; justify-content: space-around;
  padding: 6px 0 calc(8px + var(--safe-bottom));
  z-index: 100; box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0; min-width: 56px; color: var(--color-text-muted);
  font-size: 10px; font-weight: 500; cursor: pointer; background: none; border: none;
  transition: color var(--transition-fast);
}
.bottom-nav-item.active { color: var(--color-primary); }
.bottom-nav-item .nav-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.bottom-nav-item.active .nav-icon { transform: scale(1.1); }
.bottom-nav-item span { white-space: nowrap; max-width: 64px; text-align: center; overflow: hidden; text-overflow: ellipsis; }
.bottom-nav-fab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; background: none; border: none; position: relative; top: -14px;
}
.bottom-nav-fab .fab-circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--color-primary); display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: var(--shadow-green);
  transition: transform var(--transition-fast);
}
.bottom-nav-fab:active .fab-circle { transform: scale(0.92); }
.bottom-nav-fab.active .fab-circle { background: var(--color-primary-dark); }
.bottom-nav-fab span { font-size: 10px; font-weight: 500; color: var(--color-text-muted); white-space: nowrap; }
.bottom-nav-fab.active span { color: var(--color-primary); }

/* --- Modal --- */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-content {
  width: 100%; max-width: var(--max-width);
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-2xl);
  padding-bottom: calc(var(--space-2xl) + var(--safe-bottom));
  transform: translateY(100%);
  transition: transform 350ms cubic-bezier(0.32,0.72,0,1);
  max-height: 85vh; overflow-y: auto;
}
.modal-overlay.open .modal-content { transform: translateY(0); }
.modal-handle { width: 40px; height: 4px; background: var(--color-border); border-radius: 2px; margin: 0 auto var(--space-xl); }
.modal-title { font-family: var(--font-heading); font-size: 18px; font-weight: 600; margin-bottom: var(--space-xl); }

/* --- Toast --- */
.toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 300; width: calc(100% - 32px); max-width: calc(var(--max-width) - 32px);
  pointer-events: none;
}
.toast {
  background: var(--color-text-primary); color: #fff;
  padding: 14px 20px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: var(--space-sm);
  box-shadow: var(--shadow-lg);
  transform: translateY(-100px); opacity: 0;
  transition: all 300ms cubic-bezier(0.32,0.72,0,1);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--color-primary); }
.toast-error { background: var(--color-danger); }

/* --- Icon Circle --- */
.icon-circle {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.icon-circle-sm { width: 36px; height: 36px; }
.icon-circle-lg { width: 56px; height: 56px; }
.icon-circle-green { background: var(--color-primary-lighter); color: var(--color-primary); }
.icon-circle-red { background: #FDECEA; color: var(--color-accent-red); }
.icon-circle-blue { background: #E3F2FD; color: var(--color-accent-blue); }
.icon-circle-orange { background: #FFF3E0; color: var(--color-accent-orange); }
.icon-circle-purple { background: #EDE7F6; color: var(--color-accent-purple); }

/* --- Menu List Item --- */
.menu-item {
  display: flex; align-items: center; gap: var(--space-lg);
  padding: var(--space-lg); background: var(--color-surface);
  border-radius: var(--radius-md); cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.menu-item:active { background: var(--color-bg); transform: scale(0.98); }
.menu-item .menu-item-content { flex: 1; min-width: 0; }
.menu-item .menu-item-title { font-weight: 600; font-size: 15px; }
.menu-item .menu-item-subtitle { font-size: 13px; color: var(--color-text-secondary); margin-top: 2px; }
.menu-item .menu-item-chevron { color: var(--color-text-muted); flex-shrink: 0; }

/* --- Divider --- */
.divider { height: 1px; background: var(--color-divider); margin: var(--space-sm) 0; }

/* --- Loading Spinner --- */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3.5px solid rgba(27, 122, 61, 0.12);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

