/* ========================================
   ExtraFans Portal - Refined Design System
   Design Philosophy: Elegant, Purposeful, Timeless
   ======================================== */

/* ==================== Base Styles ==================== */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-feature-settings:
    "kern" 1,
    "liga" 1;
  letter-spacing: -0.011em;
}

/* Subtle Grid Background */
.bg-grid-pattern {
  background-color: #fafafa;
  background-image:
    linear-gradient(0deg, rgba(212, 150, 92, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 150, 92, 0.02) 1px, transparent 1px);
  background-size: 32px 32px;
}

.bg-dot-pattern {
  background-color: #fafafa;
  background-image: radial-gradient(
    circle,
    rgba(212, 150, 92, 0.08) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
}

/* ==================== Refined Utilities ==================== */

.gradient-primary {
  background: linear-gradient(135deg, #f0b373 0%, #d4965c 100%);
}

.gradient-card {
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.shadow-soft {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.02);
}

.shadow-hover {
  box-shadow:
    0 8px 20px rgba(212, 150, 92, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.04);
}

/* ==================== Copy Button ==================== */

.copy-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(135deg, #f0b373 0%, #d4965c 100%);
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 150, 92, 0.2);
}

.copy-btn:active {
  transform: translateY(0);
}

.copy-btn.copied {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.copy-btn.copied::after {
  content: "✓ Copied";
  position: absolute;
  top: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #171717;
  color: #ffffff;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  animation: fadeInOut 2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
  10%,
  90% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ==================== ID Display ==================== */

.id-display {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
  border: 1px solid #e5e5e5;
  border-radius: 0.75rem;
}

.id-display-alias {
  font-family: "SF Mono", "Monaco", "Courier New", monospace;
  font-size: 1.5rem;
  font-weight: 600;
  color: #171717;
  letter-spacing: 0.02em;
}

.id-display-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #737373;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.id-display-uuid {
  font-family: "SF Mono", "Monaco", "Courier New", monospace;
  font-size: 0.75rem;
  color: #a3a3a3;
  cursor: pointer;
  transition: color 0.2s;
}

.id-display-uuid:hover {
  color: #525252;
}

/* ==================== Progress Steps ==================== */

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 2rem;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.progress-step::after {
  content: "";
  position: absolute;
  top: 1.25rem;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e5e5e5;
  z-index: -1;
}

.progress-step:last-child::after {
  display: none;
}

.progress-step.active .progress-step-circle {
  background: linear-gradient(135deg, #f0b373 0%, #d4965c 100%);
  color: #ffffff;
  border-color: transparent;
}

.progress-step.completed .progress-step-circle {
  background: #10b981;
  color: #ffffff;
  border-color: transparent;
}

.progress-step.completed::after {
  background: #10b981;
}

.progress-step-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid #e5e5e5;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
}

.progress-step-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #737373;
  margin-top: 0.5rem;
  text-align: center;
}

.progress-step.active .progress-step-label {
  color: #d4965c;
  font-weight: 600;
}

.progress-step.completed .progress-step-label {
  color: #10b981;
}

/* ==================== Cards ==================== */

.card-primary {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.02);
  border: 1px solid #f5f5f5;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-primary:hover {
  box-shadow:
    0 8px 20px rgba(212, 150, 92, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.card-animated {
  animation: cardEntrance 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f5f5f5;
  background: #fafafa;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1.5rem;
  border-top: 1px solid #f5f5f5;
  background: #fafafa;
}

/* ==================== Buttons ==================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(135deg, #f0b373 0%, #d4965c 100%);
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 150, 92, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 150, 92, 0.2);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #404040;
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
  background: #fafafa;
  border-color: #a3a3a3;
}

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* ==================== Forms ==================== */

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #404040;
  margin-bottom: 0.5rem;
}

.form-label-required::after {
  content: "*";
  color: #ef4444;
  margin-left: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: #171717;
  background: #ffffff;
  border: 1px solid #d4d4d4;
  border-radius: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:hover {
  border-color: #a3a3a3;
}

.form-input:focus {
  outline: none;
  border-color: #d4965c;
  box-shadow: 0 0 0 3px rgba(212, 150, 92, 0.1);
}

.form-input::placeholder {
  color: #a3a3a3;
}

.form-input:disabled {
  background: #fafafa;
  cursor: not-allowed;
  color: #737373;
}

.form-input.error {
  border-color: #ef4444;
}

.form-input.error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
  border-color: #10b981;
}

.form-error {
  font-size: 0.875rem;
  color: #ef4444;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-success {
  font-size: 0.875rem;
  color: #10b981;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-help {
  font-size: 0.875rem;
  color: #737373;
  margin-top: 0.25rem;
}

/* ==================== Badges ==================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.375rem;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-primary {
  background: #fef2e6;
  color: #935e32;
}

/* ==================== Modal Specific Overrides ==================== */

/* Force Tailwind utilities to work inside modals */
.modal .flex {
  display: flex !important;
}

.modal .flex-1 {
  flex: 1 1 0% !important;
}

.modal .items-center {
  align-items: center !important;
}

.modal .items-start {
  align-items: flex-start !important;
}

.modal .justify-center {
  justify-content: center !important;
}

.modal .gap-2 {
  gap: 0.5rem !important;
}

.modal .gap-3 {
  gap: 0.75rem !important;
}

.modal .gap-4 {
  gap: 1rem !important;
}

.modal .grid {
  display: grid !important;
}

.modal .space-y-4 > * + * {
  margin-top: 1rem !important;
}

.modal .space-y-6 > * + * {
  margin-top: 1.5rem !important;
}

.modal .hidden {
  display: none !important;
}

.modal .text-center {
  text-align: center !important;
}

.modal .text-left {
  text-align: left !important;
}

.modal .relative {
  position: relative !important;
}

.modal .absolute {
  position: absolute !important;
}

@media (min-width: 768px) {
  .modal .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ==================== Modals ==================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
}

.modal-container {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 32rem;
  width: 100%;
  transform: scale(1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #171717;
}

.modal-close {
  color: #737373;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #404040;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==================== Utilities ==================== */

.text-gradient-primary {
  background: linear-gradient(135deg, #f0b373 0%, #d4965c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hover-lift {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

/* ==================== Animations ==================== */

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(1rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-1rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-in-right {
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-in-left {
  animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-slide-up {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger delay utilities for sequential animations */
.delay-100 {
  animation-delay: 100ms;
}
.delay-200 {
  animation-delay: 200ms;
}
.delay-300 {
  animation-delay: 300ms;
}
.delay-400 {
  animation-delay: 400ms;
}

/* ==================== Responsive Design ==================== */

@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }

  .card-header,
  .card-footer {
    padding: 1rem;
  }

  .modal-content {
    margin: 1rem;
  }
}

/* ==================== Bootstrap Modal Overrides ==================== */

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}

@media (min-width: 576px) {
  .modal-dialog-centered {
    min-height: calc(100% - 3.5rem);
  }
}

.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: none;
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 0.5;
  backdrop-filter: blur(4px);
}

/* Fix modal z-index to ensure proper layering */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055 !important;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.show {
  display: block !important;
}

.modal-backdrop {
  z-index: 1050 !important;
}

/* Ensure modals are properly positioned */
.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
}

.modal-content {
  pointer-events: auto;
}

@media (min-width: 576px) {
  .modal-dialog {
    margin: 1.75rem auto;
  }

  .modal-dialog-centered {
    min-height: calc(100vh - 3.5rem);
  }
}
