@import '@fortawesome/fontawesome-free/css/all.min.css';

/* Optimized font loading with fallbacks */
@font-face {
  font-family: 'Inter';
  src: local('Inter'),
       url('/fonts/Inter/Inter-VariableFont_opsz,wght.ttf') format('truetype');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Fallback font stack for better performance */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}

@tailwind base;
@tailwind components;
@tailwind utilities;

/* --- General & Base Styles --- */
body {
  scroll-behavior: smooth;
}

img {
  background-color: #f1f5f9; /* slate-100 */
}

/* FIX: Prevent mobile zoom on input fields by ensuring font-size is at least 16px */
input[type="email"],
input[type="text"],
input[type="file"],
button,
textarea {
  font-size: 16px !important;
}

/* --- REDESIGNED MODAL STYLES --- */

/* Modal Overlay & Animation */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
  align-items: center; /* Center modal vertically by default */
  justify-content: center; /* Center modal horizontally */
}

/* Modal Content Container */
.modal-content {
  background-color: #ffffff;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  max-height: 90dvh; /* Dynamic viewport height for mobile (#8) */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1);
}

/* Mobile modal optimization (#8) */
@media (max-width: 640px) {
  .modal.active {
    align-items: flex-end; /* Align modal to bottom on mobile */
  }
  
  .modal-content {
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 1.5rem 1.5rem 0 0;
    margin: 0;
    width: 100%;
  }
  
  .modal-header {
    padding: 0.75rem 1rem; /* Compact header padding */
  }

  .modal-body {
    padding: 1.25rem 1rem; /* Compact body padding */
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  /* Compact timeline for mobile */
  .timeline-circle {
    width: 1.75rem; /* 28px - even smaller on mobile */
    height: 1.75rem; /* 28px - even smaller on mobile */
    font-size: 0.75rem;
  }
  
  .timeline-label {
    font-size: 0.7rem;
  }
  
  .timeline-connector, 
  .timeline-connector-progress {
    top: 0.875rem; /* Align with center of 1.75rem circle */
  }

  .modal-step > p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
  }
}

/* Body scroll lock when modal is open (#9) */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Modal Header */
.modal-header {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
  position: relative;
}

#modalTitle {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}


/* Modal Body */
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

/* Timeline */
#modalTimeline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 0;
  position: relative;
}

.timeline-connector {
  position: absolute;
  top: 1rem; /* Center of 2rem circle */
  left: 2.5rem;
  right: 2.5rem;
  height: 2px;
  background-color: #e2e8f0;
  z-index: 0;
}

.timeline-connector-progress {
  position: absolute;
  top: 1rem; /* Center of 2rem circle */
  left: 2.5rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #ec4899 0%, #8b5cf6 100%);
  z-index: 1;
  transition: width 0.4s ease;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  width: 110px;
  text-align: center;
}

/* Timeline circles with minimum touch target (#10) */
.timeline-circle {
  width: 2rem; /* 32px - smaller bubbles */
  height: 2rem; /* 32px - smaller bubbles */
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background-color: #ffffff;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  margin-bottom: 0.25rem;
}

.timeline-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  transition: color 0.3s ease;
  line-height: 1.3;
}

.timeline-step.active .timeline-circle,
.timeline-step.completed .timeline-circle {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: white;
  font-weight: bold;
  border: none;
}

.timeline-step.active .timeline-label {
  color: #1e293b;
  font-weight: 600;
}

/* Form Steps & Transitions - Using display toggle with fade animation (#13) */
.modal-step {
  width: 100%;
  display: none;
}

.modal-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Form Elements Styling */
.modal-step > p {
  text-align: center;
  color: #475569;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.5rem;
}

input[type="email"], 
input[type="text"] {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background-color: #f8fafc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="email"]:focus, 
input[type="text"]:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px #8b5cf633;
}

/* IMPROVED File Input */
.file-drop-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2.5rem 1.5rem;
  border: 2.5px dashed #8b5cf6; /* More prominent purple border */
  border-radius: 1.25rem; /* Larger radius */
  background: linear-gradient(135deg, #f0f9ff 60%, #f8fafc 100%); /* Subtle blue/white gradient */
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-align: center;
  color: #7c3aed;
  box-shadow: 0 2px 8px 0 rgba(236, 72, 153, 0.06);
  position: relative;
}

.file-drop-area.drag-over,
.file-drop-area:hover,
.file-drop-area:focus-within {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #fdf2f8 80%, #f3e8ff 100%);
  box-shadow: 0 4px 16px 0 rgba(236, 72, 153, 0.12);
}

.file-drop-area i {
  font-size: 2.5rem;
  color: #8b5cf6;
  margin-bottom: 1rem;
  transition: color 0.2s;
}

.file-drop-area.drag-over i,
.file-drop-area:hover i {
  color: #7c3aed;
}

.file-drop-area-text {
  font-weight: 600;
  font-size: 1.1rem;
  color: #7c3aed;
  margin-bottom: 0.25rem;
}

.file-drop-area-desc {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 0;
}

#imagePreviewContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.preview-image-wrapper {
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.preview-image {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

/* Touch target minimum 44x44px (#10) */
.remove-image-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 2.75rem; /* 44px for touch target */
  height: 2.75rem; /* 44px for touch target */
  border-radius: 50%;
  background-color: transparent;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  transition: background-color 0.2s;
}

.remove-image-btn::before {
  content: '';
  position: absolute;
  width: 1.5rem;
  height: 1.5rem;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  z-index: -1;
  transition: background-color 0.2s;
}

.remove-image-btn:hover::before {
  background-color: rgba(0, 0, 0, 0.8);
}

/* IMPROVED Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem; /* Increased padding */
  border-radius: 0.75rem; /* Larger radius */
  font-weight: 700; /* Bolder */
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(90deg, #8b5cf6 0%, #a21caf 100%);
  color: white;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.btn:disabled {
  background-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  background-image: none;
  box-shadow: none;
}

.btn-secondary {
  background-color: transparent;
  color: #64748b;
  margin-top: 0.75rem;
  font-weight: 500;
}

.btn-secondary:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

/* Consent Checkbox */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #475569;
  margin: 1.5rem 0;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
}

.consent-label a {
  color: #8b5cf6;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Processing Step Styles */
#processingStep { 
  text-align: center; 
  padding: 2rem 0; 
}

#processingStep h3 { 
  font-size: 1.25rem; 
  font-weight: 700; 
  color: #1e293b; 
  margin-bottom: 0.5rem; 
}

#processingStep p { 
  color: #475569; 
  margin-bottom: 2rem; 
}

#progressBar { 
  height: 0.5rem; 
  background-color: #e2e8f0; 
  border-radius: 9999px; 
  overflow: hidden; 
  margin-bottom: 2rem; 
}

#progressBarFill { 
  background-color: #8b5cf6; 
  width: 0%; 
  height: 100%; 
  border-radius: 9999px; 
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

/* Simple spinner and check styles - with will-change for performance (#12) */
.spinner {
  display: inline-block;
  will-change: transform;
}

.check {
  display: none;
  color: #22c55e;
}

/* Trust Facts Container - prevent layout shifting (#1) */
.trust-fact-container {
  position: relative;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#trustFact {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  transition: opacity 0.3s ease;
}

/* Processing status - fixed grid layout to prevent shifting (#2) */
.processing-status {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.5rem;
  align-items: center;
  max-width: 16rem;
  margin: 0 auto 1.5rem;
}

.processing-status__icon {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing-status__text {
  text-align: left;
  min-width: 0;
}

/* Smooth progress bar animation (#15) */
#progressBar {
  will-change: transform;
}

#progressBar.animating {
  animation: progress-fill var(--progress-duration, 10s) linear forwards;
}

@keyframes progress-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

#redirecting-message { 
  color: #22c55e; 
  font-weight: 600; 
  margin-top: 2rem; 
  display: none; 
}

/* Legacy styles for existing components */
.blur-content {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
}

.score-display {
  filter: blur(0);
  user-select: auto;
  pointer-events: auto;
}

.report-container {
  position: relative;
}

.unlock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
} 

.how-it-works-step {
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

/* Progress bar styles */
.progress-bar {
  background: linear-gradient(90deg, #8b5cf6, #a21caf);
  transition: width 0.15s ease-linear;
} 

/* --- CAROUSEL STYLES --- */
.carousel-container {
  overflow: hidden;
  position: relative;
}

#carousel-track {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  scroll-snap-type: x mandatory;
}

#carousel-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.carousel-slide {
  flex: 0 0 102px; /* Reduced from 113px by another 10% */
  min-width: 102px; /* Reduced from 113px by another 10% */
  padding: 0;
  box-sizing: border-box;
  transition: transform 0.3s ease;
  scroll-snap-align: start;
}

.carousel-slide:hover {
  transform: translateY(-4px);
}

.carousel-image {
  width: 100%;
  height: auto;
  max-height: 204px; /* Reduced from 227px by another 10% */
  object-fit: contain;
  border-radius: 1rem;
  background-color: #fef7f7;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-image:hover {
  transform: scale(1.02);
}

/* Responsive adjustments */
@media (min-width: 769px) {
  #carousel-track {
    overflow-x: hidden; /* Disable scrolling on desktop */
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .carousel-slide {
    flex: 0 0 87px; /* Reduced from 97px by another 10% */
    min-width: 87px; /* Reduced from 97px by another 10% */
  }
  
  .carousel-image {
    max-height: 175px; /* Reduced from 194px by another 10% */
    border-radius: 0.875rem;
  }
  
  #carousel-track {
    gap: 0.75rem;
    justify-content: flex-start; /* Left align on mobile for scrolling */
  }
}

@media (max-width: 480px) {
  .carousel-slide {
    flex: 0 0 95px; /* Reduced from 105px by another 10% */
    min-width: 95px; /* Reduced from 105px by another 10% */
  }
  
  .carousel-image {
    max-height: 190px; /* Reduced from 211px by another 10% */
  }
  
  #carousel-track {
    gap: 0.5rem;
  }
}

/* Loading state */
.carousel-image.loading {
  background: transparent;
  animation: loading-shimmer 2s ease-in-out infinite;
}

@keyframes loading-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
} 
