/* ═══════════════════════════════════════════════════════════════
   Bootstrap Replacement Components
   Replaces: modal, form-control, btn variants, badge, card,
   list-group, spacing utilities, alert
   ═══════════════════════════════════════════════════════════════ */

/* ── Modal ──────────────────────────────────────────────────── */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.show {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.15s linear;
}

.modal-backdrop.show {
  opacity: 1;
}

.modal.fade .modal-dialog {
  transform: translateY(-30px);
  opacity: 0;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.modal.fade.show .modal-dialog {
  transform: translateY(0);
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: auto;
  max-width: 500px;
  margin: 1.75rem auto;
  pointer-events: none;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 3.5rem);
}

.modal-lg {
  max-width: 800px;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #1a1a2e;
  background-clip: padding-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  outline: 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: #fff;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 20px;
  color: #fff;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 8px;
}

.btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
  position: relative;
}

.btn-close::before,
.btn-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background-color: #fff;
}

.btn-close::before {
  transform: rotate(45deg);
}

.btn-close::after {
  transform: rotate(-45deg);
}

.btn-close:hover {
  opacity: 1;
}

.btn-close-white::before,
.btn-close-white::after {
  background-color: #fff;
}

/* ── Form Controls ──────────────────────────────────────────── */

.form-control {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-family: Unbounded, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary-color, #7b61ff);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.25);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-label {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 400;
  color: #fff;
}

.form-select {
  display: block;
  width: 100%;
  padding: 8px 36px 8px 12px;
  font-size: 14px;
  font-family: Unbounded, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  appearance: none;
  outline: none;
}

.form-select:focus {
  border-color: var(--primary-color, #7b61ff);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.25);
}

.form-check-input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  vertical-align: top;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xs);
  appearance: none;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--primary-color, #7b61ff);
  border-color: var(--primary-color, #7b61ff);
}

.form-check-label {
  font-size: 14px;
  color: #fff;
  cursor: pointer;
}

/* ── Buttons ────────────────────────────────────────────────── */

.btn-primary {
  background: var(--primary-color, #7b61ff);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-primary:hover {
  background: #6551d9;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: #198754;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-success:hover {
  background: #157347;
}

.btn-danger {
  background: #dc3545;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: Unbounded, sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-danger:hover {
  background: #bb2d3b;
}

/* ── Badge ──────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--radius-xs);
  color: #fff;
}

/* ── Card ───────────────────────────────────────────────────── */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: rgba(255, 255, 255, 0.05);
  background-clip: border-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: #fff;
}

.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-body {
  flex: 1 1 auto;
  padding: 16px;
}

.card-text {
  margin: 0;
}

.card-title {
  margin-bottom: 8px;
  font-weight: 500;
}

.card-img {
  width: 100%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ── List Group ─────────────────────────────────────────────── */

.list-group {
  display: flex;
  flex-direction: column;
  padding-left: 0;
  margin-bottom: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.list-group-item {
  position: relative;
  display: block;
  padding: 8px 12px;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.list-group-item + .list-group-item {
  border-top-width: 0;
}

.list-group-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ── Alert ──────────────────────────────────────────────────── */

.alert-message {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 8px;
}

/* ── Spacing Utilities ──────────────────────────────────────── */

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.my-4 { margin-top: 24px; margin-bottom: 24px; }
.me-2 { margin-right: 8px; }

.d-flex { display: flex; }
.d-none { display: none; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* ── Responsive Modal ───────────────────────────────────────── */

@media (max-width: 768px) {
  .modal-dialog {
    max-width: calc(100% - 32px);
    margin: 16px auto;
  }

  .modal-lg {
    max-width: calc(100% - 32px);
  }

  .modal-header {
    padding: 12px 16px;
  }

  .modal-body {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
  }
}
