/* ===== BUTTONS - Button variants, states, and button-specific styling ===== */

/* Button Success Variant */
.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-success:hover {
  background-color: #1e7e34;
}

/* Button Warning Variant */
.btn-warning {
  background-color: #ffc107;
  color: #212529;
}

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

/* Button Danger Variant */
.btn-danger {
  background-color: #dc3545;
  color: white;
}

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

/* Button Small Variant */
.btn-sm {
  font-size: 12px;
  padding: 4px 8px;
}

/* Button Error Variant */
.btn-error {
  background-color: #dc3545;
  color: white;
}

.btn-error:hover {
  background-color: #c82333;
}

/* Button Warn Variant */
.btn-warn {
  background-color: #ffc107;
  color: #212529;
}

.btn-warn:hover {
  background-color: #e0a800;
}

/* Button Info Variant */
.btn-info {
  background-color: #17a2b8;
  color: white;
}

.btn-info:hover {
  background-color: #138496;
}

/* Button Light Variant */
.btn-light {
  background-color: #f8f9fa;
  color: #212529;
  border: 1px solid #dee2e6;
}

.btn-light:hover {
  background-color: #e2e6ea;
  border-color: #adb5bd;
}

/* Button Dark Variant */
.btn-dark {
  background-color: #343a40;
  color: white;
}

.btn-dark:hover {
  background-color: #23272b;
}

/* Button Outline Variants */
.btn-outline-primary {
  color: #007bff;
  border: 1px solid #007bff;
  background-color: transparent;
}

.btn-outline-primary:hover {
  color: white;
  background-color: #007bff;
}

.btn-outline-secondary {
  color: #6c757d;
  border: 1px solid #6c757d;
  background-color: transparent;
}

.btn-outline-secondary:hover {
  color: white;
  background-color: #6c757d;
}

.btn-outline-success {
  color: #28a745;
  border: 1px solid #28a745;
  background-color: transparent;
}

.btn-outline-success:hover {
  color: white;
  background-color: #28a745;
}

.btn-outline-danger {
  color: #dc3545;
  border: 1px solid #dc3545;
  background-color: transparent;
}

.btn-outline-danger:hover {
  color: white;
  background-color: #dc3545;
}

.btn-outline-warning {
  color: #ffc107;
  border: 1px solid #ffc107;
  background-color: transparent;
}

.btn-outline-warning:hover {
  color: #212529;
  background-color: #ffc107;
}

.btn-outline-info {
  color: #17a2b8;
  border: 1px solid #17a2b8;
  background-color: transparent;
}

.btn-outline-info:hover {
  color: white;
  background-color: #17a2b8;
}

/* Button Size Variants */
.btn-lg {
  font-size: 18px;
  padding: 12px 24px;
}

.btn-xl {
  font-size: 20px;
  padding: 16px 32px;
}

/* Button State Modifiers */
.btn:disabled,
.btn.disabled {
  opacity: 0.65;
  pointer-events: none;
  cursor: not-allowed;
}

.btn.active {
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.btn:focus {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button Group Styling */
.btn-group {
  display: inline-flex;
  vertical-align: middle;
}

.btn-group > .btn {
  position: relative;
  flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child) {
  margin-left: -1px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.btn-group > .btn:focus,
.btn-group > .btn:active,
.btn-group > .btn:hover {
  z-index: 1;
}

/* Button with Icon Styling */
.btn .btn-icon {
  margin-right: 8px;
  font-size: 14px;
}

.btn .btn-icon:only-child {
  margin-right: 0;
}

/* Button Loading State */
.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Button Block Variant */
.btn-block {
  display: block;
  width: 100%;
}

/* Button with Badge */
.btn .badge {
  margin-left: 8px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.2);
  color: inherit;
}

/* Button with Dropdown Arrow */
.btn-dropdown::after {
  content: '▼';
  margin-left: 8px;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.btn-dropdown[aria-expanded='true']::after {
  transform: rotate(180deg);
}

/* Button with Progress Bar */
.btn-progress {
  position: relative;
  overflow: hidden;
}

.btn-progress .progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.3);
  transition: width 0.3s ease;
}

/* Button with Tooltip */
.btn[data-tooltip] {
  position: relative;
}

.btn[data-tooltip]:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 5px;
}

.btn[data-tooltip]:hover::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #333;
  z-index: 1000;
}
