/* ============================================
   COMPONENTS - Buttons, Cards, Forms, Modals
   Flo Faction Component Library
   ============================================ */

/* BUTTON COMPONENTS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
  gap: 8px;
}

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

.btn-primary {
  background: var(--primary, #1b82ff);
  color: white;
  box-shadow: 0 4px 12px rgba(27, 130, 255, 0.3);
}

.btn-primary:hover {
  background: #0a5fc4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 130, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--secondary, #7cf5ff);
  color: #000;
}

.btn-secondary:hover {
  background: #5ae8f8;
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success, #3bffb0);
  color: #000;
}

.btn-success:hover {
  background: #1dd4a0;
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger, #ff5f6d);
  color: white;
}

.btn-danger:hover {
  background: #e63946;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary, #1b82ff);
  color: var(--primary, #1b82ff);
}

.btn-outline:hover {
  background: rgba(27, 130, 255, 0.1);
}

.btn-ghost {
  background: transparent;
  color: var(--primary, #1b82ff);
}

.btn-ghost:hover {
  background: rgba(27, 130, 255, 0.1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.125rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* CARD COMPONENTS */

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(27, 130, 255, 0.3);
  box-shadow: 0 12px 32px rgba(27, 130, 255, 0.1);
}

.card-header {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-strong);
}

.card-body {
  color: var(--text-dim);
  line-height: 1.6;
}

.card-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 12px;
}

.card-compact {
  padding: 16px;
}

.card-lg {
  padding: 32px;
}

.card-elevated {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-gradient {
  background: linear-gradient(135deg, rgba(124, 245, 255, 0.1), rgba(255, 122, 217, 0.1));
}

/* FORM COMPONENTS */

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-strong);
}

.form-label.required::after {
  content: '*';
  color: var(--danger, #ff5f6d);
  margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-strong);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary, #1b82ff);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(27, 130, 255, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(233, 242, 255, 0.5);
}

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

.form-help {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.form-error {
  border-color: var(--danger, #ff5f6d) !important;
  background: rgba(255, 95, 109, 0.05);
}

.form-error-message {
  color: var(--danger, #ff5f6d);
  font-size: 0.85rem;
  margin-top: 6px;
}

.form-success {
  border-color: var(--success, #3bffb0) !important;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.form-checkbox,
.form-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.form-checkbox input[type="checkbox"],
.form-radio input[type="radio"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #1b82ff);
}

/* MODAL COMPONENTS */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--surface, #0a1729);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-strong);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* BADGE COMPONENTS */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  gap: 4px;
}

.badge-primary {
  background: rgba(27, 130, 255, 0.1);
  color: var(--primary, #1b82ff);
}

.badge-success {
  background: rgba(59, 255, 176, 0.1);
  color: var(--success, #3bffb0);
}

.badge-warning {
  background: rgba(255, 209, 102, 0.1);
  color: var(--warning, #ffd166);
}

.badge-danger {
  background: rgba(255, 95, 109, 0.1);
  color: var(--danger, #ff5f6d);
}

/* ALERT COMPONENTS */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid;
  animation: slideInDown 0.4s ease;
}

.alert-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.alert-primary {
  background: rgba(27, 130, 255, 0.1);
  border-color: var(--primary, #1b82ff);
  color: var(--primary, #1b82ff);
}

.alert-success {
  background: rgba(59, 255, 176, 0.1);
  border-color: var(--success, #3bffb0);
  color: var(--success, #3bffb0);
}

.alert-warning {
  background: rgba(255, 209, 102, 0.1);
  border-color: var(--warning, #ffd166);
  color: var(--warning, #ffd166);
}

.alert-danger {
  background: rgba(255, 95, 109, 0.1);
  border-color: var(--danger, #ff5f6d);
  color: var(--danger, #ff5f6d);
}

/* RESPONSIVE */

@media (max-width: 768px) {
  .card {
    padding: 16px;
  }
  
  .modal {
    width: 95%;
    border-radius: 12px;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 0.95rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}
