/* Custom Animations and Styles for The Witness Website */

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

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

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

::-webkit-scrollbar-thumb {
    background: #D4AF37;
    border-radius: 4px;
}

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

/* Hero section parallax effect */
#hero {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

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

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

/* Stagger animation for cards */
.stagger-animation {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.stagger-animation:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation:nth-child(6) { animation-delay: 0.6s; }

/* Glowing text effect */
.glow-text {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* Floating animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Pulse animation for buttons */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.1);
}

/* Text reveal animation */
@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.text-reveal {
    animation: textReveal 0.6s ease-out forwards;
}

/* Image overlay effects */
.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.image-overlay:hover::before {
    left: 100%;
}

/* Loading animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #D4AF37, #FFD700, #B8941F);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
}

/* Intersection Observer animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

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

/* Custom button styles */
.btn-primary {
    background: linear-gradient(135deg, #D4AF37, #FFD700);
    color: #000000 !important;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #B8941F, #D4AF37);
    color: #000000 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3);
}

/* Button text on one line */
button, .btn, a.btn {
    white-space: nowrap;
    min-width: fit-content;
}

/* Responsive button adjustments */
@media (max-width: 640px) {
    button, .btn, a.btn {
        font-size: 0.875rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section button {
        font-size: 1rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-section button {
        font-size: 0.875rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Navbar blur effect */
.navbar-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Gallery grid animations */
.gallery-item {
    transition: all 0.3s ease;
    opacity: 1 !important;
}

.gallery-item:hover {
    z-index: 10;
}

.gallery-item img {
    opacity: 1 !important;
    display: block !important;
    width: 100% !important;
    height: 256px !important; /* Fixed height to match h-64 class */
    object-fit: cover !important;
    min-height: 256px !important;
}

/* Ensure gallery grid is properly displayed */
#gallery .grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
    width: 100% !important;
}

#gallery .gallery-item {
    display: block !important;
    width: 100% !important;
    min-height: 256px !important;
}

@media (min-width: 768px) {
    #gallery .grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (min-width: 1024px) {
    #gallery .grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Typography enhancements */
.title-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Responsive video container */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Footer animations */
.footer-link {
    position: relative;
    transition: color 0.3s ease;
}

.footer-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #D4AF37;
    transition: width 0.3s ease;
}

.footer-link:hover::after {
    width: 100%;
}

/* Cookie banner slide animation - unified with main site */
#cookie-banner {
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
}

#cookie-banner.show {
    transform: translateY(0);
}

/* Enhanced loading animations */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Enhanced button loading states */
.btn-loading {
    position: relative;
    overflow: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1s infinite;
}

/* Page transition animations */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.page-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced gallery hover effects */
.gallery-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.gallery-item:hover {
    transform: scale(1.05) translateY(-5px);
    z-index: 10;
    box-shadow: 0 25px 50px rgba(212, 175, 55, 0.3);
}

/* Video thumbnail styling removed - direct Mux player embed now used */

/* Scroll to Top Button Styles */
#scrollToTopBtn {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease-in-out;
}

#scrollToTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#scrollToTopBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* Play button and video thumbnail text styling removed - direct Mux player embed now used */

/* Social media icon animations */
.social-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-icon:hover {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 5px 15px rgba(212, 175, 55, 0.4));
}

/* Enhanced modal animations */
.modal-enter {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Preload critical resources */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* Optimize animations for performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
button:focus,
a:focus {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
}

.hero-desc {
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-subtitle {
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.lighter-hero-overlay {
    background: linear-gradient(90deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0) 100%) !important;
}
.lighter-hero {
    /* Optionally reduce image overlay opacity for even lighter effect */
}

.cast-card-img {
    width: 8rem;
    height: 8rem;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.cast-card-text {
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cast-card-text h3,
.cast-card-text p.font-medium {
    text-align: center;
    width: 100%;
}

.cast-card-text p.text-gray-300 {
    text-align: left;
    width: 100%;
}

/* --- KingdomFlix Footer Styles --- */
.footer-section {
  background: #000;
  color: #fff;
  padding-top: 3rem;
  padding-bottom: 3rem;
  border-top: 1px solid #FFD70022;
}
.footer-section .footer-cta {
  text-align: center;
  margin-bottom: 2.5rem;
}
.footer-section .footer-cta-text {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: #fff;
  font-weight: 500;
}
.footer-section .footer-form {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}
.footer-section .footer-form input[type="text"],
.footer-section .footer-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  border: none;
  background: #141414;
  color: #fff;
  font-size: 1rem;
}
.footer-section .footer-form input[type="text"]::placeholder,
.footer-section .footer-form input[type="email"]::placeholder {
  color: #bbb;
}
.footer-section .footer-form button {
  background: #FFD700;
  color: #000000 !important;
  font-weight: bold;
  border: none;
  border-radius: 0.375rem;
  padding: 0 2rem;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.2s;
}
.footer-section .footer-form button:hover {
  background: #e6c200;
  color: #000000 !important;
}

/* Ensure all gold buttons have black text */
.bg-gold,
.bg-kingdom-gold,
[class*="bg-yellow"],
[class*="bg-amber"] {
    color: #000000 !important;
}

/* Ensure all gold buttons have black text for all states */
button[class*="bg-gold"]:hover,
button[class*="bg-kingdom-gold"]:hover,
button[class*="bg-yellow"]:hover,
button[class*="bg-amber"]:hover,
button[class*="bg-gold"]:active,
button[class*="bg-kingdom-gold"]:active,
button[class*="bg-yellow"]:active,
button[class*="bg-amber"]:active,
button[class*="bg-gold"]:focus,
button[class*="bg-kingdom-gold"]:focus,
button[class*="bg-yellow"]:focus,
button[class*="bg-amber"]:focus {
    color: #000000 !important;
}

/* Force black text on any gold background elements */
.bg-gold *,
.bg-kingdom-gold *,
[class*="bg-yellow"] *,
[class*="bg-amber"] * {
    color: #000000 !important;
}
.footer-section .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-section .footer-col {
  min-width: 180px;
}
.footer-section .footer-col h4 {
  color: #FFD700;
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer-section .footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-section .footer-col ul li {
  margin-bottom: 0.75rem;
}
.footer-section .footer-col ul li a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.footer-section .footer-col ul li a:hover {
  border-bottom: 1px solid #FFD700;
}
.footer-section .footer-bottom {
  border-top: 1px solid #FFD70022;
  padding-top: 1.5rem;
  text-align: center;
  color: #bbb;
  font-size: 0.95rem;
}
@media (max-width: 900px) {
  .footer-section .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  .footer-section .footer-col {
    min-width: 0;
    width: 100%;
    text-align: center;
  }
  .footer-section .footer-form {
    flex-direction: column;
    gap: 1rem;
  }
}

