/* ============================================
   Smile Team Turkey - Custom Styles
   Apple-Health Aesthetic: Clean, High Whitespace
   ============================================ */

/* ---------- Quiz Component Styles ---------- */

.smile-quiz {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .smile-quiz {
    padding: 2rem;
  }
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.progress-dots {
  display: flex;
  gap: 0.5rem;
}

.progress-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background-color: #e5e7eb;
  transition: all 0.3s ease;
}

.progress-dot.active {
  background-color: #14b8a6;
  width: 1.5rem;
}

.progress-dot.completed {
  background-color: #14b8a6;
}

.progress-text {
  font-size: 0.875rem;
  color: #9ca3af;
}

.quiz-question {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .quiz-question {
    font-size: 1.5rem;
  }
}

.quiz-subtext {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.quiz-options {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 2px solid #f3f4f6;
  background-color: #ffffff;
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}

.quiz-option:hover {
  border-color: #99f6e4;
  background-color: rgba(240, 253, 250, 0.3);
}

.quiz-option.selected {
  border-color: #14b8a6;
  background-color: #f0fdfa;
}

.option-icon {
  font-size: 1.5rem;
}

.option-label {
  color: #374151;
  font-weight: 500;
}

.quiz-back {
  margin-top: 1.5rem;
  color: #9ca3af;
  font-size: 0.875rem;
  transition: color 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
}

.quiz-back:hover {
  color: #4b5563;
}

/* Form Styles */
.quiz-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  position: relative;
}

.quiz-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  color: #111827;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.quiz-input::placeholder {
  color: #9ca3af;
}

.quiz-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #14b8a6;
  border-color: transparent;
}

/* Intl Tel Input Customization */
.phone-field .iti {
  width: 100%;
}

.phone-field .iti__tel-input {
  width: 100%;
  padding: 0.875rem 1rem;
  padding-left: 90px; /* Space for country selector */
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background-color: #f9fafb;
  color: #111827;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.phone-field .iti__tel-input::placeholder {
  color: #9ca3af;
}

.phone-field .iti__tel-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #14b8a6;
  border-color: transparent;
}

.phone-field .iti__country-container {
  padding-left: 0.75rem;
}

.phone-field .iti__selected-dial-code {
  color: #374151;
  font-size: 0.9rem;
}

/* Fix dropdown z-index for modal */
.iti__dropdown {
  z-index: 10001 !important;
}

/* Phone validation error */
.phone-field.has-error .iti__tel-input {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.phone-error-message {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.quiz-submit {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #00d9ff 0%, #06b6d4 20%, #14b8a6 40%, #10b981 60%, #059669 80%, #047857 100%);
  background-size: 300% 300%;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  animation: gradient-shift 3s ease infinite;
  box-shadow: 0 4px 25px rgba(0, 217, 255, 0.6);
}

.quiz-submit:hover {
  animation-duration: 1.5s;
  box-shadow: 0 6px 30px rgba(0, 217, 255, 0.8);
  transform: translateY(-1px);
}

.quiz-submit:focus {
  outline: none;
  box-shadow: 0 0 0 2px #14b8a6, 0 0 0 4px #ffffff;
}

.quiz-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Confirmation Screen */
.quiz-confirm-details {
  margin: 1.5rem 0;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
  overflow: hidden;
}

.quiz-confirm-row {
  display: flex;
  align-items: center;
  padding: 0;
  border-bottom: 1px solid #f3f4f6;
}

.quiz-confirm-row:last-child {
  border-bottom: none;
}

.quiz-confirm-label {
  font-size: 0.875rem;
  color: #9ca3af;
  flex-shrink: 0;
  width: 5rem;
  padding: 0.875rem 1rem;
  border-right: 1px solid #f3f4f6;
}

.quiz-confirm-value {
  font-weight: 500;
  color: #111827;
  text-align: left;
  word-break: break-word;
  padding: 0.875rem 1rem;
}

.hidden {
  display: none !important;
}

/* Loading State */
.quiz-loading {
  text-align: center;
  padding: 3rem 0;
}

.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 24rem;
  margin: 0 auto;
}

.skeleton-line {
  height: 1rem;
  background-color: #e5e7eb;
  border-radius: 0.25rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-line.w-3\/4 {
  width: 75%;
}

.skeleton-line.w-1\/2 {
  width: 50%;
  margin: 0 auto;
}

.skeleton-block {
  height: 3.5rem;
  background-color: #e5e7eb;
  border-radius: 0.75rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-text {
  color: #9ca3af;
  margin-top: 1.5rem;
}

.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 9999px;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Success State */
.quiz-success {
  text-align: center;
  padding: 3rem 0;
}

.success-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.5rem;
}

.checkmark {
  width: 100%;
  height: 100%;
}

.checkmark-circle {
  stroke: #14b8a6;
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkmark-circle 0.6s ease-in-out forwards;
}

.checkmark-check {
  stroke: #14b8a6;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkmark-check 0.3s ease-in-out 0.6s forwards;
}

@keyframes checkmark-circle {
  to { stroke-dashoffset: 0; }
}

@keyframes checkmark-check {
  to { stroke-dashoffset: 0; }
}

.success-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.success-text {
  color: #6b7280;
  max-width: 24rem;
  margin: 0 auto;
}

/* Success – Next steps */
.success-next-steps-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #374151;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.success-next-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 20rem;
  margin: 0 auto;
}

.success-next-step-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background-color: #f9fafb;
  color: #374151;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.success-next-step-link:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

/* Instagram */
.success-next-step-link--instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  border-color: transparent;
}

.success-next-step-link--instagram .success-next-step-svg {
  fill: #fff;
}

/* YouTube */
.success-next-step-link--youtube {
  background-color: #ff0000;
  color: #fff;
  border-color: #cc0000;
}

.success-next-step-link--youtube:hover {
  background-color: #e60000;
}

.success-next-step-link--youtube .success-next-step-svg {
  fill: #fff;
}

/* Trustpilot */
.success-next-step-link--trustpilot {
  background-color: #00b67a;
  color: #fff;
  border-color: #009e6a;
}

.success-next-step-link--trustpilot:hover {
  background-color: #00a370;
}

.success-next-step-link--trustpilot .success-next-step-svg {
  fill: #fff;
}

.success-next-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.success-next-step-icon .success-next-step-svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Error State */
.quiz-error {
  text-align: center;
  padding: 3rem 0;
}

.error-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.5rem;
}

.error-text {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.quiz-retry {
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.quiz-retry:hover {
  background-color: #f9fafb;
}

/* Modal Styles */
.quiz-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  opacity: 0;
  transition: all 0.3s ease-out;
}

.quiz-modal-overlay.open {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 1;
}

.quiz-modal {
  position: relative;
  background-color: #ffffff;
  border-radius: 1rem;
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease-out;
}

.quiz-modal-overlay.open .quiz-modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem;
  color: #9ca3af;
  border-radius: 9999px;
  transition: all 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.modal-close:hover {
  color: #4b5563;
  background-color: #f3f4f6;
}

#quiz-modal-content {
  padding: 1.5rem;
}

@media (min-width: 768px) {
  #quiz-modal-content {
    padding: 2rem;
  }
}

#quiz-modal-content .smile-quiz {
  padding: 0;
}

/* ---------- FAQ Accordion Styles ---------- */

.faq-item {
  border-bottom: 1px solid #f3f4f6;
}

.faq-question {
  width: 100%;
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: #111827;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: #0d9488;
}

.faq-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #9ca3af;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  max-height: 0;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-content {
  padding-bottom: 1.25rem;
  color: #4b5563;
  line-height: 1.625;
}

/* ---------- Utility Classes ---------- */

.text-balance {
  text-wrap: balance;
}

/* Smooth scroll for anchor links */
html {
  scroll-behavior: smooth;
}

/* Safe area for iOS devices with notch/home indicator */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Footer bottom spacing is handled dynamically by JavaScript
   based on sticky CTA visibility */

/* Focus styles for accessibility */
*:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #14b8a6, 0 0 0 4px #ffffff;
}

/* Animation utilities */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* Animated gradient for CTA buttons */
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.cta-gradient {
  background: linear-gradient(135deg, #00d9ff 0%, #06b6d4 20%, #14b8a6 40%, #10b981 60%, #059669 80%, #047857 100%);
  background-size: 300% 300%;
  animation: gradient-shift 3s ease infinite;
  box-shadow: 0 4px 25px rgba(0, 217, 255, 0.6);
  transition: all 0.3s ease;
}

.cta-gradient:hover {
  animation-duration: 1.5s;
  box-shadow: 0 6px 30px rgba(0, 217, 255, 0.8);
  transform: translateY(-2px);
}

.cta-gradient:active {
  transform: translateY(0);
}

/* ---------- Smile Carousel Styles (Splide) ---------- */

#smile-carousel {
  overflow: visible;
}

#smile-carousel .splide__slide {
  max-width: 400px;
}

#smile-carousel .splide__slide img {
  pointer-events: none;
  user-select: none;
  max-height: 400px;
  width: 100%;
  height: auto;
}

#carousel-prev,
#carousel-next {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
}

#carousel-prev:hover,
#carousel-next:hover {
  opacity: 1;
}

@media (max-width: 767px) {
  #carousel-prev,
  #carousel-next {
    padding: 0.5rem;
  }
  
  #carousel-prev svg,
  #carousel-next svg {
    width: 1.5rem;
    height: 1.5rem;
  }
}
