/* Import Bootstrap 5, Font Awesome and bs-stepper styles */
@import "~bootstrap/dist/css/bootstrap.min.css";
@import "~@fortawesome/fontawesome-free/css/all.min.css";
@import "~bs-stepper/dist/css/bs-stepper.min.css";

/*
 * Font Awesome 7 defaults to fixed-width icon canvases.
 * Keep v6-era layout behavior unless fixed width is explicitly requested.
 */
.fa,
.fa-solid,
.fas,
.fa-regular,
.far,
.fa-brands,
.fab {
  --fa-width: auto;
}

.fa-fw {
  --fa-width: 1.25em;
  width: var(--fa-width);
  text-align: center;
}

/* ==========================================================================
   ChurchCRM Setup Wizard - Tabler/Bootstrap 5 Integration
   ========================================================================== */

/* Base Styles */
body {
  background: var(--bs-gray-100);
  min-height: 100vh;
  padding-bottom: 2rem;
}

/* Setup Container - Centered, max-width (Tabler container-xl pattern) */
.setup-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* ==========================================================================
   Hero Section (Tabler page header style)
   ========================================================================== */

.setup-hero {
  text-align: center;
  padding: 1.875rem 1.25rem 1.25rem;
}

.setup-logo {
  max-width: 320px;
  width: 100%;
  margin-bottom: 0.75rem;
}

.setup-version {
  font-size: 1.1rem;
  color: var(--bs-gray-600);
  margin-bottom: 0.5rem;
}

.setup-tagline {
  color: var(--bs-gray-600);
  font-size: 1rem;
  margin: 0;
}

/* ==========================================================================
   BS Stepper - Clean Progress Indicator (Tabler themed)
   ========================================================================== */

#setup-stepper.bs-stepper {
  background: transparent;
  box-shadow: none;
}

#setup-stepper .bs-stepper-header {
  background: var(--bs-white);
  padding: 1.5rem 2rem;
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow-sm);
  margin-bottom: 1.5rem;
  justify-content: center;
  gap: 0;
}

#setup-stepper .bs-stepper-header .step {
  padding: 0;
  position: relative;
}

#setup-stepper .bs-stepper-header .step-trigger {
  padding: 0.75rem 1rem;
  font-weight: 500;
  border-radius: var(--bs-border-radius);
  transition: background 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#setup-stepper .bs-stepper-header .step-trigger:hover {
  background: var(--bs-gray-100);
}

#setup-stepper .bs-stepper-circle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  background: var(--bs-gray-100);
  color: var(--bs-gray-600);
  border: 2px solid var(--bs-gray-300);
  border-radius: 50%;
  transition: all 0.3s ease;
}

#setup-stepper .step.active .bs-stepper-circle {
  background: var(--bs-primary);
  color: var(--bs-white);
  border-color: var(--bs-primary);
  box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-primary-rgb), 0.35);
}

/* Completed step styling */
#setup-stepper .step.completed .bs-stepper-circle {
  background: var(--bs-success);
  color: var(--bs-white);
  border-color: var(--bs-success);
}

#setup-stepper .bs-stepper-label {
  font-size: 0.875rem;
  color: var(--bs-gray-600);
  margin-left: 0;
  transition: color 0.2s ease;
}

#setup-stepper .step.active .bs-stepper-label {
  color: var(--bs-primary);
  font-weight: 600;
}

#setup-stepper .step.completed .bs-stepper-label {
  color: var(--bs-success);
  font-weight: 500;
}

#setup-stepper .line {
  flex: 0 0 80px;
  height: 2px;
  background: var(--bs-gray-200);
  margin: 0 0.5rem;
  margin-bottom: 1.75rem;
  border-radius: 1px;
  transition: background 0.3s ease;
}

/* Line after completed step */
#setup-stepper .step.completed + .line {
  background: var(--bs-success);
}

#setup-stepper .bs-stepper-content {
  padding: 0;
}

#setup-stepper .content {
  display: none;
}

#setup-stepper .content.active {
  display: block;
}

/* ==========================================================================
   Status Banner - Overall Check Status (Tabler alert pattern)
   ========================================================================== */

.status-banner {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-radius: var(--bs-border-radius);
  margin-bottom: 1.25rem;
  background: var(--bs-white);
  border-left: 4px solid var(--bs-primary);
  box-shadow: var(--bs-box-shadow-sm);
}

.status-banner.status-checking {
  border-left-color: var(--bs-primary);
  background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0.08) 0%, var(--bs-white) 100%);
}

.status-banner.status-success {
  border-left-color: var(--bs-success);
  background: linear-gradient(90deg, rgba(var(--bs-success-rgb), 0.1) 0%, var(--bs-white) 100%);
}

.status-banner.status-warning {
  border-left-color: var(--bs-warning);
  background: linear-gradient(90deg, rgba(var(--bs-warning-rgb), 0.12) 0%, var(--bs-white) 100%);
}

.status-banner.status-error {
  border-left-color: var(--bs-danger);
  background: linear-gradient(90deg, rgba(var(--bs-danger-rgb), 0.08) 0%, var(--bs-white) 100%);
}

.status-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  width: 40px;
  text-align: center;
}

.status-checking .status-icon {
  color: var(--bs-primary);
}

.status-success .status-icon {
  color: var(--bs-success);
}

.status-warning .status-icon {
  color: var(--bs-warning);
}

.status-error .status-icon {
  color: var(--bs-danger);
}

.status-text strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.125rem;
}

.status-detail {
  font-size: 0.875rem;
  color: var(--bs-gray-600);
}

/* ==========================================================================
   Check Cards - Collapsible Sections (Tabler card pattern)
   ========================================================================== */

.check-card {
  background: var(--bs-white);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

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

.check-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.check-header:hover {
  background: var(--bs-gray-100);
}

.check-header-warning {
  background: rgba(var(--bs-warning-rgb), 0.1);
}

.check-title {
  display: flex;
  align-items: center;
  font-weight: 500;
  font-size: 0.95rem;
}

.check-icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  color: var(--bs-gray-600);
  width: 20px;
  text-align: center;
}

.check-badges .badge {
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  margin-left: 0.375rem;
}

.check-status {
  font-size: 1rem;
}

.check-details {
  border-top: 1px solid var(--bs-border-color-translucent);
  background: var(--bs-gray-50);
  padding: 0;
}

.check-details .table {
  margin: 0;
  font-size: 0.875rem;
  background: transparent;
}

.check-details .table td {
  padding: 0.75rem 1.25rem;
  vertical-align: middle;
  border-top: none;
  border-bottom: 1px solid var(--bs-gray-100);
}

.check-details .table td:first-child {
  font-weight: 500;
  color: var(--bs-gray-800);
}

.check-details .table td:last-child {
  text-align: right;
}

.check-details .table tr:last-child td {
  border-bottom: none;
}

/* Integrity check details */
.integrity-details-row {
  background: #fff5f5;
}

.check-details .integrity-details-row > td {
  padding: 16px 20px;
}

.integrity-details-header {
  font-weight: 600;
  color: var(--setup-danger);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.integrity-files-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.integrity-files-list li {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: var(--setup-gray-700);
  padding: 6px 12px;
  background: white;
  border-radius: 4px;
  margin-bottom: 6px;
  border-left: 3px solid var(--setup-danger);
}

.integrity-files-list li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Step Intro - Section Headers
   ========================================================================== */

.step-intro {
  text-align: center;
  margin-bottom: 1.5rem;
}

.step-intro h4 {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--bs-gray-900);
}

.step-intro p {
  margin: 0;
  color: var(--bs-gray-600);
}

/* ==========================================================================
   Form Cards - Configuration Panels (Tabler card pattern)
   ========================================================================== */

.form-card {
  background: var(--bs-white);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-card .mb-3 {
  margin-bottom: 1.25rem;
}

.form-card .mb-3:last-child {
  margin-bottom: 0;
}

.form-card label {
  font-weight: 500;
  margin-bottom: 0.375rem;
  font-size: 0.9rem;
}

.form-card .form-control {
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
  padding: 0.625rem 0.875rem;
  font-size: 0.95rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.form-card .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}

/* Form validation feedback - Bootstrap 5 style */
.form-card .form-control.is-invalid {
  border-color: var(--bs-danger);
}

.form-card .form-control.is-invalid:focus {
  border-color: var(--bs-danger);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-danger-rgb), 0.15);
}

.form-card .form-control.is-valid {
  border-color: var(--bs-success);
}

.form-card .form-control.is-valid:focus {
  border-color: var(--bs-success);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-success-rgb), 0.15);
}

.form-card .form-control.form-control-lg {
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.form-card .form-text {
  font-size: 0.8rem;
  margin-top: 0.375rem;
}

/* ==========================================================================
   Advanced Settings (collapsed by default)
   ========================================================================== */

.advanced-settings {
  padding: 0;
  overflow: hidden;
}

.advanced-header {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.25rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--bs-gray-600);
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--bs-border-color-translucent);
}

.advanced-header:hover {
  background: var(--bs-gray-100);
}

.advanced-header .toggle-icon {
  transition: transform 0.2s ease;
}

.advanced-header[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

.advanced-body {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--bs-border-color-translucent);
  background: var(--bs-gray-50);
}

.advanced-body .form-group {
  margin-bottom: 1rem;
}

.advanced-body .form-control {
  font-size: 0.9rem;
}

/* ==========================================================================
   Action Buttons (Tabler button patterns)
   ========================================================================== */

.setup-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 0 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--bs-border-color-translucent);
}

.setup-actions .btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.setup-actions .btn {
  min-width: 200px;
  border-radius: var(--bs-border-radius);
  font-weight: 500;
  padding: 0.75rem 2rem;
}

.setup-actions .btn-primary {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-primary-rgb), 0.3);
}

.setup-actions .btn-primary:hover {
  background: #0d6efd;
  border-color: #0d6efd;
  box-shadow: 0 0.375rem 1rem rgba(var(--bs-primary-rgb), 0.4);
}

.setup-actions .btn-success {
  background: var(--bs-success);
  border-color: var(--bs-success);
  box-shadow: 0 0.25rem 0.75rem rgba(var(--bs-success-rgb), 0.3);
}

.setup-actions .btn-success:hover {
  background: #198754;
  border-color: #198754;
  box-shadow: 0 0.375rem 1rem rgba(var(--bs-success-rgb), 0.4);
}

.setup-actions .btn-outline-secondary {
  color: var(--bs-gray-600);
  border: none;
  background: transparent;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  min-width: auto;
}

.setup-actions .btn-outline-secondary:hover {
  background: var(--bs-gray-100);
  color: var(--bs-gray-800);
}

.setup-actions .btn-outline-secondary i {
  font-size: 0.85rem;
}

.setup-actions .btn-outline-warning {
  color: var(--bs-warning);
  border: 1px solid var(--bs-warning);
  background: rgba(var(--bs-warning-rgb), 0.1);
  font-size: 0.9rem;
  padding: 0.625rem 1.5rem;
  min-width: 180px;
}

.setup-actions .btn-outline-warning:hover {
  background: var(--bs-warning);
  color: var(--bs-gray-900);
}

/* ==========================================================================
   Modals (Tabler modal styling)
   ========================================================================== */

.modal-content {
  border-radius: var(--bs-border-radius);
  border: none;
  box-shadow: var(--bs-box-shadow);
}

.modal-header {
  border-bottom: 1px solid var(--bs-border-color-translucent);
  border-radius: var(--bs-border-radius) var(--bs-border-radius) 0 0;
}

.modal-footer {
  border-top: 1px solid var(--bs-border-color-translucent);
}

/* Success checkmark animation */
.success-checkmark {
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   Alert Styling (Tabler alert variants)
   ========================================================================== */

.alert {
  border-left: 4px solid;
  border-radius: var(--bs-border-radius);
}

.alert-info {
  border-left-color: var(--bs-info);
  background: linear-gradient(90deg, rgba(var(--bs-info-rgb), 0.1) 0%, var(--bs-white) 100%);
}

.alert-success {
  border-left-color: var(--bs-success);
  background: linear-gradient(90deg, rgba(var(--bs-success-rgb), 0.1) 0%, var(--bs-white) 100%);
}

.alert-warning {
  border-left-color: var(--bs-warning);
  background: linear-gradient(90deg, rgba(var(--bs-warning-rgb), 0.1) 0%, var(--bs-white) 100%);
}

.alert-danger {
  border-left-color: var(--bs-danger);
  background: linear-gradient(90deg, rgba(var(--bs-danger-rgb), 0.08) 0%, var(--bs-white) 100%);
}

/* Integrity check details */
.integrity-details-row {
  background: rgba(var(--bs-danger-rgb), 0.05);
}

.check-details .integrity-details-row > td {
  padding: 1rem 1.25rem;
}

.integrity-details-header {
  font-weight: 600;
  color: var(--bs-danger);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.625rem;
}

.integrity-files-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.integrity-files-list li {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8rem;
  color: var(--bs-gray-800);
  padding: 0.375rem 0.75rem;
  background: var(--bs-white);
  border-radius: var(--bs-border-radius);
  margin-bottom: 0.375rem;
  border-left: 3px solid var(--bs-danger);
}

.integrity-files-list li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  #setup-stepper .line {
    flex: 0 0 50px;
  }
}

@media (max-width: 576px) {
  .setup-container {
    padding: 0.75rem;
  }

  .setup-hero {
    padding: 1.25rem 0.75rem 1rem;
  }

  .setup-logo {
    max-width: 260px;
  }

  #setup-stepper .bs-stepper-header {
    padding: 1rem 0.75rem;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  #setup-stepper .bs-stepper-header .step-trigger {
    padding: 0.5rem 0.75rem;
  }

  #setup-stepper .bs-stepper-circle {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  #setup-stepper .bs-stepper-label {
    font-size: 0.75rem;
  }

  #setup-stepper .line {
    flex: 0 0 30px;
    margin: 0 0.25rem;
    margin-bottom: 1.5rem;
  }

  .status-banner {
    padding: 0.875rem 1rem;
  }

  .check-header {
    padding: 0.75rem 1rem;
  }

  .check-badges {
    display: none;
  }

  .form-card {
    padding: 1.25rem 1rem;
  }

  .setup-actions {
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1.5rem;
  }

  .setup-actions .btn {
    width: 100%;
    min-width: unset;
  }

  .setup-actions .btn-row {
    flex-direction: column;
    width: 100%;
  }

  .setup-actions .btn-outline-warning {
    font-size: 0.875rem;
  }
}
