/* ==========================================================================
   NMW ONE COMPONENTS STYLES
   Buttons, Inputs, Cards, Tables, Modals, Toasts, Badges, Tabs
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BUTTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-family-body);
  font-size: var(--fs-body);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-spring);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  opacity: 0.94;
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--accent-color);
  color: var(--text-inverse);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-neutral);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   2. INPUTS & FORM CONTROLS
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--text-main);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font-family: var(--font-family-body);
  font-size: var(--fs-body);
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--duration-fast) var(--ease-spring);
}

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

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder {
  color: var(--text-subtle);
}

/* --------------------------------------------------------------------------
   3. CARDS & CONTAINER GLASSMORPHISM
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-fast) var(--ease-spring);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: var(--fs-h3);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   4. DATA TABLE
   -------------------------------------------------------------------------- */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--fs-body);
}

.data-table th {
  background: var(--bg-surface-hover);
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-neutral);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

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

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

/* --------------------------------------------------------------------------
   5. BADGES & CHIPS
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: var(--fs-micro);
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info);    }

/* --------------------------------------------------------------------------
   6. MODAL DIALOG OVERLAY
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal) var(--ease-spring);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: all var(--duration-normal) var(--ease-spring);
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-neutral);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-neutral);
  background: var(--bg-surface-hover);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* --------------------------------------------------------------------------
   7. TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

@media (max-width: 768px) {
  #toast-container {
    left: 20px;
    right: 20px;
    bottom: 80px;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-neutral);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-size: var(--fs-body);
  font-weight: 500;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-spring);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}
