/* ============================================================
   SmartAdmin Bootstrap 5 - Components
   CSS Module: Buttons, Cards, Badges, Alerts, Modals
   ============================================================ */

/* Buttons */
.btn {
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: var(--bs-border-radius);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Button Sizes */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

/* Button Variants */
.btn-primary {
  background-color: var(--bs-primary);
  color: white;
  border-color: var(--bs-primary);
}

.btn-primary:hover {
  background-color: #1976d2;
  border-color: #1976d2;
}

.btn-success {
  background-color: var(--bs-success);
  color: white;
  border-color: var(--bs-success);
}

.btn-success:hover {
  background-color: #45a049;
  border-color: #45a049;
}

.btn-danger {
  background-color: var(--bs-danger);
  color: white;
  border-color: var(--bs-danger);
}

.btn-danger:hover {
  background-color: #da190b;
  border-color: #da190b;
}

.btn-warning {
  background-color: var(--bs-warning);
  color: white;
  border-color: var(--bs-warning);
}

.btn-warning:hover {
  background-color: #e68900;
  border-color: #e68900;
}

/* Button Groups */
.btn-group {
  display: inline-flex;
  gap: 0.25rem;
}

.btn-group .btn {
  margin-right: 0;
}

/* Cards */
.card {
  border: 1px solid var(--bs-gray-200);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow);
  transition: all 0.3s ease;
  overflow: hidden;
}

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

.card-header {
  background-color: var(--bs-gray-50);
  border-bottom: 1px solid var(--bs-gray-200);
  padding: 1rem;
  font-weight: 600;
}

[data-bs-theme="dark"] .card-header {
  background-color: var(--bs-gray-800);
  border-bottom-color: var(--bs-gray-700);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  background-color: var(--bs-gray-50);
  border-top: 1px solid var(--bs-gray-200);
  padding: 1rem;
}

[data-bs-theme="dark"] .card-footer {
  background-color: var(--bs-gray-800);
  border-top-color: var(--bs-gray-700);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-text {
  color: var(--bs-gray-600);
  margin-bottom: 1rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--bs-border-radius-pill);
}

.badge-primary {
  background-color: var(--bs-primary);
  color: white;
}

.badge-success {
  background-color: var(--bs-success);
  color: white;
}

.badge-danger {
  background-color: var(--bs-danger);
  color: white;
}

.badge-warning {
  background-color: var(--bs-warning);
  color: white;
}

.badge-info {
  background-color: var(--bs-info);
  color: white;
}

.badge-secondary {
  background-color: var(--bs-secondary);
  color: white;
}

.badge-pill {
  padding-left: 0.6em;
  padding-right: 0.6em;
  border-radius: var(--bs-border-radius-pill);
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--bs-border-radius);
  border: 1px solid transparent;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-heading {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.alert-primary {
  background-color: #e3f2fd;
  border-color: #90caf9;
  color: #1565c0;
}

[data-bs-theme="dark"] .alert-primary {
  background-color: rgba(33, 150, 243, 0.1);
  border-color: #90caf9;
  color: #90caf9;
}

.alert-success {
  background-color: #e8f5e9;
  border-color: #81c784;
  color: #2e7d32;
}

[data-bs-theme="dark"] .alert-success {
  background-color: rgba(76, 175, 80, 0.1);
  border-color: #81c784;
  color: #81c784;
}

.alert-danger {
  background-color: #ffebee;
  border-color: #ef9a9a;
  color: #c62828;
}

[data-bs-theme="dark"] .alert-danger {
  background-color: rgba(244, 67, 54, 0.1);
  border-color: #ef9a9a;
  color: #ef9a9a;
}

.alert-warning {
  background-color: #fff3e0;
  border-color: #ffb74d;
  color: #e65100;
}

[data-bs-theme="dark"] .alert-warning {
  background-color: rgba(255, 152, 0, 0.1);
  border-color: #ffb74d;
  color: #ffb74d;
}

.alert-info {
  background-color: #e0f2f1;
  border-color: #80deea;
  color: #00695c;
}

[data-bs-theme="dark"] .alert-info {
  background-color: rgba(0, 188, 212, 0.1);
  border-color: #80deea;
  color: #80deea;
}

.alert-dismissible {
  padding-right: 1.5rem;
}

.btn-close {
  padding: 0.25rem;
  color: inherit;
  text-decoration: none;
  opacity: 0.5;
  float: right;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

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

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  overflow-y: auto;
}

.modal.show {
  display: block;
}

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

.modal-dialog.modal-sm {
  max-width: 300px;
}

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

.modal-dialog.modal-xl {
  max-width: 1140px;
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--bs-body-bg);
  background-clip: padding-box;
  border: 1px solid var(--bs-gray-300);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--bs-box-shadow-lg);
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--bs-gray-200);
}

/* Spinners */
.spinner-border {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.2em;
}

@keyframes spinner-border {
  to {
    transform: rotate(360deg);
  }
}

.spinner-grow {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  vertical-align: text-bottom;
  border-radius: 50%;
  animation: spinner-grow 0.75s linear infinite;
  background-color: currentColor;
  opacity: 0.25;
}

@keyframes spinner-grow {
  0% {
    transform: scale(0);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tooltips & Popovers */
.tooltip {
  position: absolute;
  z-index: 1070;
  display: none;
  max-width: 100%;
  padding: 0.25rem 0.5rem;
  margin-top: 0.1rem;
  font-size: 0.875rem;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.9);
  border-radius: var(--bs-border-radius);
}

.tooltip.show {
  display: block;
}

.tooltip-inner {
  max-width: 100%;
  padding: 0.25rem 0.5rem;
  text-align: center;
  background-color: #000;
  border-radius: var(--bs-border-radius);
}
