/* Custom styles for HeraldryResEncy */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Module card hover effects */
.module-card,
.featured-module {
  transition: all 0.3s ease;
}

.module-card:hover,
.featured-module:hover {
  transform: translateY(-5px) scale(1.02);
}

/* Category card effects */
.category-card {
  transition: all 0.3s ease;
}

.category-card:active {
  transform: scale(0.98);
}

/* Text line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #fef3c7;
}

::-webkit-scrollbar-thumb {
  background: #d97706;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b45309;
}

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Enhanced focus styles for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #d97706;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  nav,
  footer,
  .category-card,
  #mobileMenuBtn {
    display: none;
  }

  body {
    background: white;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .text-6xl {
    font-size: 3rem;
  }

  .text-8xl {
    font-size: 4rem;
  }
}

/* Enhanced typography */
.font-serif {
  font-family: 'Georgia', 'Times New Roman', serif;
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, #92400e, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card shadow variations */
.shadow-heraldic {
  box-shadow: 0 10px 25px rgba(146, 64, 14, 0.2);
}

/* Button press effect */
button:active,
a.button:active {
  transform: scale(0.95);
}

/* Form input focus ring */
input:focus,
textarea:focus,
select:focus {
  ring: 2px;
  ring-color: #d97706;
}

/* Smooth transitions for all interactive elements */
a,
button,
.module-card,
.category-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero section enhancements */
.hero-section {
  background: linear-gradient(
      135deg,
      rgba(146, 64, 14, 0.3),
      rgba(180, 83, 9, 0.7)
    ),
    url('https://images.unsplash.com/photo-1655145893830-e9e10a64e62a?fm=jpg&q=60&w=3000&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
  background-size: cover, 200px 200px;
  background-position: center, center;
  background-repeat: no-repeat, repeat;
  min-height: 500px;
  display: flex;
  align-items: center;
  margin-top: 0;
  margin-bottom: 0;
  border-bottom: 4px solid rgba(146, 64, 14, 0.3);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    rgba(146, 64, 14, 0.4),
    rgba(146, 64, 14, 0.8)
  );
  z-index: 1;
}

header h2 {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .hero-section {
    min-height: 400px;
    padding: 3rem 1rem;
  }
}

/* Navigation sticky behavior enhancement */
nav {
  backdrop-filter: blur(10px);
  background-color: rgba(146, 64, 14, 0.95);
}

/* Module grid responsive adjustments */
@media (max-width: 640px) {
  .grid {
    gap: 1rem;
  }
}

/* Enhanced card borders */
.border-amber-200 {
  border-color: #fde68a;
}

/* Loading state styles */
#loadingIndicator {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Contact form enhancements */
#contactForm input,
#contactForm textarea,
#contactForm select {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contactForm input:focus,
#contactForm textarea:focus,
#contactForm select:focus {
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* Success/Error message styles */
#formMessage {
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
}

#formMessage p {
  margin: 0;
  font-weight: 500;
}

/* Footer link hover effects */
footer a {
  position: relative;
  transition: color 0.3s ease;
}

footer a:hover {
  color: #fde68a;
}

/* Detail page image container */
.detail-image {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* Related modules section */
.related-module {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-module:hover {
  transform: translateY(-3px);
}

/* Accessibility: Skip to main content link */
.skip-to-main {
  position: absolute;
  left: -9999px;
  z-index: 999;
}

.skip-to-main:focus {
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 2rem;
  background: #92400e;
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
}

/* Enhanced mobile menu */
#mobileMenu {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Content section spacing */
section {
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  section {
    margin-bottom: 4rem;
  }
}

/* Prose styling for detail content */
.prose {
  color: #92400e;
  line-height: 1.75;
}

.prose p {
  margin-bottom: 1.25em;
}

.prose h2 {
  font-size: 1.5em;
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 1em;
  color: #78350f;
}

.prose h3 {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  color: #92400e;
}

/* Enhanced button styles */
button[type="submit"],
a.button {
  position: relative;
  overflow: hidden;
}

button[type="submit"]:before,
a.button:before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

button[type="submit"]:hover:before,
a.button:hover:before {
  width: 300px;
  height: 300px;
}
