/**
 * Bill Audit Calculator - Styles
 * Consistent with Frugal Indians design theme
 */

/* ========================================
   Variables & Reset
   ======================================== */

:root {
  --primary-color: #0d6efd;
  --success-color: #198754;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --info-color: #0dcaf0;
  --gray-dark: #495057;
  --gray-medium: #6c757d;
  --gray-light: #adb5bd;
  --gray-lighter: #e9ecef;
  --gray-lightest: #f8f9fa;
  --white: #ffffff;
  --text-white-75: rgba(255, 255, 255, 0.75);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-dark);
}

/* ========================================
   Progress Track
   ======================================== */

.bill-audit-progress-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 2rem 3rem;
  background-color: var(--white);
  border-bottom: 1px solid var(--gray-lighter);
}

.bill-audit-progress-track::before {
  content: '';
  position: absolute;
  top: 45px;
  left: 3rem;
  width: calc(100% - 6rem);
  height: 2px;
  background-color: var(--gray-lighter);
  z-index: 1;
}

.progress-step {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
  cursor: default;
}

.progress-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--gray-lighter);
  color: var(--gray-medium);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  transition: all 0.3s ease;
  border: 3px solid var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-medium);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.progress-step.active .progress-marker {
  background-color: var(--primary-color);
  color: var(--white);
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.progress-step.active .progress-text {
  color: var(--primary-color);
  font-weight: 600;
}

.progress-step.completed .progress-marker {
  background-color: var(--success-color);
  color: var(--white);
}

.progress-step.completed .progress-text {
  color: var(--success-color);
}

/* ========================================
   Step Content
   ======================================== */

.step-content {
  display: none;
}

.step-content.active {
  display: block;
}

/* ========================================
   Feature Items (Sidebar)
   ======================================== */

.feature-item {
  transition: transform 0.2s ease;
}

.feature-item:hover {
  transform: translateX(5px);
}

.text-white-75 {
  color: var(--text-white-75) !important;
}

/* ========================================
   Form Elements
   ======================================== */

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--gray-dark);
  font-size: 0.875rem;
}

.form-control,
.form-select {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  min-height: 44px;
}

.form-control:focus,
.form-select:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  outline: 0;
}

.form-control::placeholder {
  color: var(--gray-light);
  font-size: 0.875rem;
}

.input-group-text {
  background-color: var(--gray-lightest);
  border: 1px solid #ced4da;
  border-radius: 0.375rem 0 0 0.375rem;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  color: var(--gray-medium);
}

.form-text {
  font-size: 0.75rem;
  color: var(--gray-medium);
  margin-top: 0.25rem;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 44px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

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

.btn-success:hover {
  background-color: #157347;
  border-color: #146c43;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(25, 135, 84, 0.2);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  color: var(--gray-medium);
  border-color: var(--gray-medium);
}

.btn-outline-secondary:hover {
  background-color: var(--gray-medium);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-outline-danger {
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-outline-danger:hover {
  background-color: var(--danger-color);
  color: var(--white);
}

/* ========================================
   Item Containers
   ======================================== */

.subscription-item,
.utility-item,
.other-bill-item {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gray-lighter);
  transition: background-color 0.2s ease;
}

.subscription-item:hover,
.utility-item:hover,
.other-bill-item:hover {
  background-color: rgba(13, 110, 253, 0.02);
  border-radius: 0.5rem;
  padding: 0.5rem;
  margin: 0.5rem 0;
}

.subscription-item:last-child,
.utility-item:last-child,
.other-bill-item:last-child {
  border-bottom: none;
}

/* ========================================
   Summary Cards
   ======================================== */

.subscription-summary-card,
.utility-summary-card,
.other-bill-summary-card {
  background-color: var(--gray-lightest);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--gray-lighter);
}

.subscription-summary-card:hover,
.utility-summary-card:hover,
.other-bill-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* ========================================
   Cards
   ======================================== */

.card {
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.card-body {
  padding: 1.5rem;
}

.card.shadow-sm {
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.075);
}

.card.shadow-lg {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.card.border-0 {
  border: none;
}

/* ========================================
   Alerts
   ======================================== */

.alert {
  border-left: 4px solid;
  border-radius: 0.375rem;
  padding: 1rem;
}

.alert-info {
  border-left-color: var(--info-color);
  background-color: rgba(13, 202, 240, 0.05);
  color: #055160;
}

.alert-success {
  border-left-color: var(--success-color);
  background-color: rgba(25, 135, 84, 0.05);
  color: #0f5132;
}

.alert-warning {
  border-left-color: var(--warning-color);
  background-color: rgba(255, 193, 7, 0.05);
  color: #664d03;
}

.alert-danger {
  border-left-color: var(--danger-color);
  background-color: rgba(220, 53, 69, 0.05);
  color: #842029;
}

/* ========================================
   Analysis Section
   ======================================== */

.analysis-loader {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.25rem;
}

.recommendation-card {
  border-left: 4px solid var(--primary-color);
  padding: 1.25rem;
  border-radius: 0.5rem;
  background-color: rgba(13, 110, 253, 0.05);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.recommendation-card:hover {
  background-color: rgba(13, 110, 253, 0.08);
  transform: translateX(5px);
}

.action-item {
  background-color: var(--gray-lightest);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--success-color);
  transition: all 0.3s ease;
  display: flex;
  align-items: flex-start;
}

.action-item:hover {
  background-color: var(--gray-lighter);
  transform: translateX(5px);
}

.action-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--success-color);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  flex-shrink: 0;
}

.action-item-content {
  flex: 1;
}

.action-item-priority {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-item-priority.high {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

.action-item-priority.medium {
  background-color: rgba(255, 193, 7, 0.1);
  color: #664d03;
}

.action-item-priority.low {
  background-color: rgba(25, 135, 84, 0.1);
  color: var(--success-color);
}

/* ========================================
   Spending Breakdown
   ======================================== */

.spending-category {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.spending-category:hover {
  background-color: var(--gray-lightest);
}

.category-color {
  width: 20px;
  height: 20px;
  border-radius: 0.25rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.category-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-name {
  font-weight: 500;
  color: var(--gray-dark);
}

.category-amount {
  font-weight: 600;
  color: var(--primary-color);
}

.category-bar {
  height: 8px;
  background-color: var(--gray-lighter);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.category-bar-fill {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.5s ease;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
  .bill-audit-progress-track {
    padding: 1.5rem 1rem;
  }

  .bill-audit-progress-track::before {
    left: 1rem;
    width: calc(100% - 2rem);
  }

  .progress-text {
    font-size: 0.75rem;
  }

  .progress-marker {
    width: 35px;
    height: 35px;
    font-size: 0.875rem;
  }

  .card-body {
    padding: 1rem;
  }

  .form-control,
  .form-select,
  .btn {
    padding: 12px 16px;
    font-size: 16px; /* Prevents iOS zoom */
  }
}

@media (max-width: 576px) {
  .bill-audit-progress-track {
    flex-direction: column;
    gap: 1rem;
  }

  .bill-audit-progress-track::before {
    display: none;
  }

  .progress-step {
    flex-direction: row;
    text-align: left;
  }

  .progress-marker {
    margin: 0 1rem 0 0;
  }
}

/* ========================================
   Accessibility
   ======================================== */

@media (prefers-contrast: high) {
  .btn,
  .card,
  .form-control,
  .form-select {
    border: 2px solid #000 !important;
  }

  .progress-marker {
    border-width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ========================================
   Touch Targets (Mobile)
   ======================================== */

.btn,
button,
.form-control,
.form-select,
input[type="number"],
.progress-step,
.add-subscription,
.add-utility,
.add-other-bill,
.remove-subscription,
.remove-utility,
.remove-other-bill {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .no-print,
  .btn,
  .bill-audit-progress-track,
  .add-subscription,
  .add-utility,
  .add-other-bill,
  .remove-subscription,
  .remove-utility,
  .remove-other-bill {
    display: none !important;
  }

  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }

  .card {
    width: 100% !important;
    page-break-inside: avoid;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }
}
