/**
 * RedirMe Custom Styles
 *
 * Additional styles beyond TailwindCSS for the RedirMe web package.
 * TailwindCSS is loaded via CDN in production.
 */

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  z-index: 100;
  padding: 8px 16px;
  background: #2563eb;
  color: white;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Primary Button Style */
.btn-primary {
  display: inline-block;
  background-color: #2563eb;
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 200ms;
}

.btn-primary:hover {
  background-color: #1d4ed8;
}

/* Focus Styles for Keyboard Navigation */
*:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Ensure all interactive elements are keyboard accessible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Loading State */
.loading {
  opacity: 0.6;
  cursor: wait;
}

/* Success Message */
.success-message {
  background-color: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

/* Error Message */
.error-message {
  background-color: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

/* Availability Indicator */
.available {
  color: #16a34a;
  font-weight: 600;
}

.unavailable {
  color: #dc2626;
  font-weight: 600;
}

/* Smooth Transitions */
a,
button {
  transition: all 200ms ease-in-out;
}

/* Responsive Typography */
@media (max-width: 640px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

/* Print Styles */
@media print {
  .skip-link,
  header,
  footer,
  #user-nav {
    display: none;
  }
}

/* Animation for Result Display */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 300ms ease-out;
}

/* Copy Button Feedback */
.copied {
  background-color: #16a34a !important;
}

/* Details/Summary Styling */
details summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

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

details summary::before {
  content: "▶ ";
  display: inline-block;
  transition: transform 200ms;
}

details[open] summary::before {
  transform: rotate(90deg);
}

/* Prose Styles for Terms/Privacy Pages */
.prose {
  color: #374151;
  line-height: 1.75;
}

.prose h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.prose h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose p {
  margin-bottom: 1rem;
}

.prose ul {
  margin-bottom: 1rem;
}

.prose a {
  color: #2563eb;
  text-decoration: underline;
}

.prose a:hover {
  color: #1d4ed8;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 300ms ease-in-out;
  z-index: 50;
  overflow-y: auto;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease-in-out, visibility 300ms ease-in-out;
  z-index: 40;
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Hamburger button animation */
.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #374151;
  transition: transform 300ms ease-in-out, opacity 300ms ease-in-out;
}

.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
  overflow: hidden;
}
