/* Custom styles for the landing page */

/* Site-wide content width constraint - limits all content to boundaries */
.container {
  max-width: 1000px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100% !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

/* Special wider container for specific pages like thank you page */
.thank-you-page .container {
  max-width: 950px !important;
}

/* Content container to ensure main content stays within boundaries */
.content-container {
  overflow-x: hidden; /* Prevent horizontal overflow */
  width: 100%;
  max-width: 100%;
}

/* Ensure all sections are contained */
section {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  z-index: 1; /* Lower z-index for sections */
}

/* Add separators between sections for better visual distinction */
section:not(:last-child)::after {
  content: none; /* Remove the previous separators */
}

/* Border styles for section separation */
.border-t.border-gray-100 {
  border-top-width: 1px;
  border-top-color: #f3f4f6;
}

/* Enhanced section backgrounds */
section.bg-white {
  background-color: #ffffff;
}

section.bg-gray-50 {
  background-color: #f9fafb;
}

/* Smooth scrolling behavior */
html {
  scroll-behavior: smooth;
}

/* Animation classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for lists */
.animate-on-scroll:nth-child(2) {
  transition-delay: 0.2s;
}

.animate-on-scroll:nth-child(3) {
  transition-delay: 0.4s;
}

.animate-on-scroll:nth-child(4) {
  transition-delay: 0.6s;
}

/* Form focus states */
.form-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
  border-color: #d97706;
}

/* Button hover effects */
.btn-primary {
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Send Message button hover effect */
.send-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.send-button .default-icon {
  display: inline-block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.send-button .hover-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.send-button:hover .default-icon {
  transform: translateY(20px);
  opacity: 0;
}

.send-button:hover .hover-icon {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* Custom container widths - capped at boundary limit shown in image */
@media (min-width: 1400px) {
  .container {
    max-width: 1150px !important; /* Maintain our content boundary */
  }
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 0; /* Removed rounded corners */
}

::-webkit-scrollbar-thumb:hover {
  background: #d97706;
}

/* Custom styles for form elements */
input, textarea, select {
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Additional utility classes */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hover-lift {
  transition: transform 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(90deg, #d97706, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Content box styling */
.bg-gray-50 {
  background-color: #f9fafb !important;
}

.border-l-4.border-yellow-600 {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left-width: 4px;
  border-left-color: #d97706;
}

.border-l-4.border-yellow-600:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Desktop-only styles for smaller number circles */
@media (min-width: 641px) {
  .reason-number-circle-desktop {
    width: 1.75rem !important;
    height: 1.75rem !important;
    font-size: 1rem !important;
  }
  
  /* Align the number and title containers */
  .reason-card .flex.items-start {
    align-items: center !important; /* Change from flex-start to center on desktop */
  }
}

/* Fix for thank you page number circles on mobile */
@media (max-width: 640px) {
  /* Style number circles consistently on thank you page - complete override for pill shape issue */
  #solving-together .flex-shrink-0.w-8.h-8.rounded-full {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;  /* Add minimum width to prevent collapsing */
    border-radius: 50% !important; /* Force perfect circle */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important; /* Ensure text is centered */
    aspect-ratio: 1 / 1 !important; /* Ensure it remains a perfect circle */
    flex: 0 0 2rem !important; /* Prevent flex stretching */
    margin-top: 0.25rem !important;
    padding: 0 !important; /* Remove any padding */
    line-height: 1 !important; /* Fix line height */
    font-size: 1rem !important; /* Control font size */
    font-weight: bold !important; /* Make the number bold */
    overflow: hidden !important; /* Ensure content doesn't overflow */
    background-color: #d97706 !important; /* Maintain orange color (yellow-600) */
  }
  
  /* Force flex layout to be correct */
  #solving-together .flex.items-start {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    width: 100% !important;
  }
  
  /* Give content proper space */
  #solving-together .flex.items-start > div {
    flex: 1 1 auto !important;
    padding-left: 0.5rem !important;
  }
  
  /* Make sure the grid doesn't cause layout issues */
  #solving-together .grid.grid-cols-1 {
    display: grid !important;
    width: 100% !important;
    gap: 1.5rem !important;
  }
  
  /* Ensure proper spacing between items */
  #solving-together .flex.items-start {
    margin-bottom: 0 !important;
  }

  /* Improved spacing for mobile */
  .container {
    padding-left: 9% !important;
    padding-right: 9% !important;
  }
  
  section {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
  }
  
  /* Ensure problem sections have less space between them */
  section + section {
    padding-top: 1rem;
  }
  
  .ml-14 {
    margin-left: 0 !important;
  }
  
  .flex.items-center .w-10.h-10.bg-yellow-600 {
    width: 2rem !important;
    height: 2rem !important;
  }

  /* Adjust grid and flex layouts for mobile */
  .grid.grid-cols-1 {
    width: 100%;
  }
  
  /* Improve text readability on mobile */
  .text-lg, .text-xl {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }
  
  /* Additional spacing for nested elements */
  .space-y-3, .space-y-4, .space-y-5 {
    margin-top: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Proper padding for content boxes */
  .bg-gray-50.p-5, .bg-gray-50.p-6, .bg-red-50.p-5, 
  .border-l-4.border-yellow-600, .border-l-4.border-red-600 {
    padding: 1rem !important;
  }
  
  /* Ensure buttons have proper spacing */
  .py-3.px-6 {
    padding: 0.75rem 1.5rem !important;
  }

  /* Fix padding for list items */
  li.flex.items-start {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Max width for paragraphs to improve readability */
  p.text-lg, p.text-xl {
    max-width: 100%;
  }
  
  /* Grid item adjustments */
  .grid.grid-cols-1 > div {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  /* Heading spacing */
  h1, h2, h3, h4 {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Force box sizing to include padding */
  *, *::before, *::after {
    box-sizing: border-box !important;
  }
  
  /* Ensure forms are contained */
  form, .form-container {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
}

/* Custom dropdown styles */
.custom-dropdown-container {
  position: relative;
  z-index: 9999 !important; /* Ensure dropdown container has high z-index */
}

#dropdown-options {
  position: absolute !important;
  z-index: 9999 !important; /* Ensure dropdown options appear above all content */
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: 100%; /* Make sure width is set to 100% of its container */
  background-color: white; /* Ensure background is visible */
  transform-origin: top center;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(-10px) scaleY(0.95);
  border-radius: 6px;
}

#dropdown-options:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scaleY(1);
}

.option {
  transition: background-color 0.15s ease;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.option:last-child {
  border-bottom: none;
}

#dropdown-tooltip {
  position: absolute;
  z-index: 10000 !important; /* Tooltip should be above the dropdown options */
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  background-color: #1f2937;
  color: white;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.875rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  pointer-events: none; /* Prevents the tooltip from interfering with mouse events */
}

#dropdown-tooltip.tooltip-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Add a tooltip arrow */
#dropdown-tooltip:before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 6px 6px 0;
  border-style: solid;
  border-color: transparent #1f2937 transparent transparent;
}

/* Prevent scroll within scroll issue */
.dropdown-options {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* Prevent scroll propagation */
}

/* Root level containers for dropdowns */
#dropdown-options-container,
#dropdown-tooltip-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  z-index: 99999;
  pointer-events: none;
}

#dropdown-options-container #dropdown-options {
  pointer-events: auto;
  z-index: 99999 !important;
}

#dropdown-tooltip-container #dropdown-tooltip {
  pointer-events: auto;
  position: fixed !important;
  z-index: 100000 !important;
}

/* Mobile-specific dropdown styles */
@media (max-width: 767px) {
  #dropdown-options {
    position: fixed !important;
    overflow-y: auto !important;
    max-height: 50vh !important; /* Limit height on mobile */
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    border-radius: 4px !important;
  }
  
  /* Make sure options are easily tappable */
  .option {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
  
  /* Disable tooltips on mobile - they're often not needed and can cause issues */
  #dropdown-tooltip {
    display: none !important;
  }
}

/* Confetti Canvas Styles */
canvas.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* Thank you page confetti animation */
.thank-you-page {
  position: relative;
  z-index: 1;
}

/* Success Overlay Styles */
#confetti-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

#confetti-success-overlay > div {
  background-color: rgba(26, 26, 26, 0.95);
  padding: 1.25rem;
  border-radius: 0.375rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 90%;
  width: 260px;
}

#confetti-success-overlay .icon-container {
  color: #E29700;
  margin-bottom: 0.75rem;
}

#confetti-success-overlay h3 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
  color: white;
}

#confetti-success-overlay p {
  color: #DEDEDE;
  margin-bottom: 0.1rem;
  font-size: 0.85rem;
} 