/* YouTube Title Generator Styles */

/* Mobile optimizations for the generate button */
@media (max-width: 640px) {
  #generate-btn {
    padding: 1.25rem 0.75rem;
  }

  #btn-text {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    font-size: 1.1rem;
  }

  /* Custom animation for the button */
  @keyframes gentle-glow {
    0% {
      box-shadow: 0 6px 20px rgba(255, 214, 1, 0.4),
        0 0 0 2px rgba(255, 214, 1, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
      box-shadow: 0 8px 30px rgba(255, 214, 1, 0.65),
        0 0 0 3px rgba(255, 214, 1, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
    }
    100% {
      box-shadow: 0 6px 20px rgba(255, 214, 1, 0.4),
        0 0 0 2px rgba(255, 214, 1, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    }
  }

  #generate-btn {
    animation: gentle-glow 3s infinite ease-in-out;
  }
}

/* Toast Container Styles */
.toast-container {
  position: fixed;
  top: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease-in-out;
  background-color: #1B3C6B;
  color: white;
}

/* Mobile: centered by default */
@media (max-width: 1023px) {
  .toast-container {
    left: 50% !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 80% !important;
    max-width: 80% !important;
    transform: translateX(-50%) !important;
  }
  
  .toast-container.-translate-y-full,
  .toast-container[class*="-translate-y-full"] {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(-100%) !important;
  }
  
  .toast-container:not(.hidden):not(.-translate-y-full),
  .toast-container:not(.hidden):not([class*="-translate-y-full"]) {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
  
  .toast-container[class*="left-"],
  .toast-container[class*="right-"],
  .toast-container[class*="translate-x"],
  .toast-container[class*="-translate-x"] {
    left: 50% !important;
    right: auto !important;
  }
  
  div#toast.toast-container {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
  }
  
  div#toast.toast-container.-translate-y-full {
    transform: translateX(-50%) translateY(-100%) !important;
  }
}

@media (min-width: 1024px) {
  .toast-container {
    left: auto;
    right: 1rem;
    transform: translateX(0);
  }
  
  .toast-container.translate-x-full {
    transform: translateX(100%);
  }
  
  .toast-container.translate-x-0 {
    transform: translateX(0);
  }
}

.toast-container.hidden {
  display: none !important;
}

/* Title Card Styles */
.title-card {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
}

.title-card:hover {
  border-color: #1B3C6B;
  box-shadow: 0 4px 12px rgba(27, 60, 107, 0.1);
}

.title-card .title-text {
  flex: 1;
  font-size: 1rem;
  color: #1f2937;
  line-height: 1.5;
}

.title-card .copy-btn {
  flex-shrink: 0;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.title-card .copy-btn:hover {
  background: #1B3C6B;
  border-color: #1B3C6B;
  color: white;
}

.title-card .copy-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Advanced title card styling */
.title-card.advanced {
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
  border-color: #fcd34d;
}

.title-card.advanced:hover {
  border-color: #FFD601;
  box-shadow: 0 4px 12px rgba(255, 214, 1, 0.2);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid #1B3C6B;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Email input container responsive styles */
.email-input-container {
  width: 100%;
}

@media (min-width: 640px) {
  .email-input-container {
    width: 80%;
    max-width: 400px;
  }
}

/* Character count indicator */
.char-count {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: right;
  margin-top: 0.25rem;
}

.char-count.warning {
  color: #f59e0b;
}

.char-count.error {
  color: #ef4444;
}

/* Title number badge */
.title-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  background: #1B3C6B;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 50%;
  flex-shrink: 0;
}

.title-number.advanced {
  background: #FFD601;
  color: #1B3C6B;
}

/* Fade-in animation for results */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.3s ease forwards;
}

.title-card:nth-child(1) { animation-delay: 0ms; }
.title-card:nth-child(2) { animation-delay: 100ms; }
.title-card:nth-child(3) { animation-delay: 200ms; }
.title-card:nth-child(4) { animation-delay: 300ms; }
.title-card:nth-child(5) { animation-delay: 400ms; }

/* Disable button styling */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Mobile menu toggle */
#mobile-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Placeholder for missing images */
img[src$=".png"]:not([src^="/"]):not([src^="http"]) {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAQ details element styling */
details summary {
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
}

details[open] > div {
  border: 1px solid #e5e7eb;
  border-top: none;
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* Unlock section gradient border effect */
#email-gate-section {
  position: relative;
}

#email-gate-section::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #FFD601 0%, #1B3C6B 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#email-gate-section:hover::before {
  opacity: 0.5;
}

/* Cookie consent styling overrides */
.cookie-consent {
  font-family: inherit;
}

/* Scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Focus visible states for accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #1B3C6B;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .toast-container,
  header,
  footer,
  #email-gate-section,
  .animate-pulse {
    display: none !important;
  }
  
  .title-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

