/* KingsLive Landing Page Styles */

/* Animations */
@keyframes glow {
    from { box-shadow: 0 0 20px rgba(212, 175, 55, 0.3); }
    to { box-shadow: 0 0 30px rgba(212, 175, 55, 0.6); }
}

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

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

/* Hero Section */
.hero-bg {
    background: linear-gradient(rgba(26, 26, 26, 0.7), rgba(26, 26, 26, 0.7)), url('resources/hero-cinema.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

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

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

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b8941f, #d4af37);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4);
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    padding-bottom: 0.1em;
    display: inline-block;
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Typography */
@media (max-width: 640px) {
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    h3 { font-size: 1.5rem !important; }
    .text-5xl { font-size: 2.5rem !important; }
    .text-4xl { font-size: 2rem !important; }
    .text-3xl { font-size: 1.75rem !important; }
    .text-2xl { font-size: 1.5rem !important; }
    .text-xl { font-size: 1.25rem !important; }
}

/* Hero Section - Prevent Layout Shift from Typing Animation */
#typed-headline {
    /* Reserve space for the longest text to prevent jumping */
    min-height: 3em;
    display: inline-block;
    vertical-align: top;
    width: 100%;
}

/* Mobile: Fix hero animation causing page jump */
@media (max-width: 767px) {
    #typed-headline {
        /* Enough height for 2-3 lines of text without cutting */
        min-height: 8rem;
        line-height: 1.3;
        font-size: clamp(1.5rem, 7vw, 2.5rem) !important;
        /* Allow text to wrap naturally */
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Keep cursor visible on mobile */
    .typed-cursor {
        font-size: 0.8em;
    }
    
    /* Ensure hero section doesn't jump */
    .hero-bg {
        min-height: 100vh;
    }
    
    /* Add padding to prevent overlap with header */
    .hero-content {
        padding-top: 2rem;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    #typed-headline {
        min-height: 4em;
    }
}

/* Revenue Calculator - Mobile Responsive */
@media (max-width: 640px) {
    /* Main earnings display */
    #earnings-display {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* View count earnings - prevent overflow */
    #views-100,
    #views-1000,
    #views-10000 {
        font-size: clamp(1rem, 5vw, 1.5rem) !important;
        word-break: break-word;
        overflow-wrap: break-word;
        line-height: 1.2;
    }
    
    /* Revenue calculator cards */
    .grid.grid-cols-3 {
        gap: 0.5rem !important;
    }
    
    .grid.grid-cols-3 > div {
        padding: 0.75rem 0.5rem !important;
    }
}

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    nav .flex {
        padding: 0.5rem 1rem;
    }
    
    #mobile-menu {
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }
}

/* Grid Responsiveness */
@media (max-width: 768px) {
    .grid.md\\:grid-cols-2,
    .grid.md\\:grid-cols-3,
    .grid.md\\:grid-cols-4 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

/* Card Spacing on Mobile */
@media (max-width: 640px) {
    .card-hover {
        margin-bottom: 1rem;
    }
    
    section {
        padding: 3rem 1rem !important;
    }
}

/* Button Responsiveness */
@media (max-width: 640px) {
    .btn-primary {
        width: 100%;
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    /* Hero buttons mobile */
    .hero-content a,
    .hero-content button {
        width: 100%;
        text-align: center;
    }
}

/* Hero button hover improvements */
a.border-warm-gold:hover,
button.border-warm-gold:hover {
    background-color: #d4af37 !important;
    color: #000000 !important;
    border-color: #d4af37 !important;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

/* Mobile touch states */
@media (max-width: 768px) {
    a.border-warm-gold:active,
    button.border-warm-gold:active {
        background-color: #d4af37 !important;
        color: #000000 !important;
        transform: scale(0.98);
    }
}

/* Form Responsiveness */
@media (max-width: 768px) {
    .form-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* Form Input Styles */
.form-input {
    background: rgba(45, 45, 45, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    outline: none;
}

/* Progress Bar */
.progress-bar {
    background: linear-gradient(90deg, #d4af37, #b8941f);
    transition: width 0.5s ease;
}

/* Particle Canvas */
#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-top: 3px solid #d4af37;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Image Lazy Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Chat Widget Styles */
#chat-widget {
    font-family: 'Inter', sans-serif;
}

#chat-toggle {
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4), 0 0 20px rgba(212, 175, 55, 0.2);
    animation: gentle-bounce 3s ease-in-out infinite;
}

#chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.5), 0 0 30px rgba(212, 175, 55, 0.3);
}

#chat-box {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes gentle-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #2d2d2d;
}

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

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-bg {
        background-attachment: scroll;
    }
    
    .card-hover:hover {
        transform: translateY(-4px);
    }
    
    #chat-box {
        width: calc(100vw - 2rem);
        right: 1rem;
    }
}

/* Accessibility - Focus Indicators */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .no-print,
    nav,
    #chat-widget,
    footer {
        display: none !important;
    }
}

/* FAQ Accordion Fixes */
.faq-answer {
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
}

.faq-answer.hidden {
    max-height: 0 !important;
    opacity: 0 !important;
}

/* Logo Styles */
nav img[alt="KingsLive Logo"] {
    filter: drop-shadow(0 2px 4px rgba(212, 175, 55, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

nav img[alt="KingsLive Logo"]:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.5));
}

footer img[alt="KingsLive Logo"] {
    filter: drop-shadow(0 4px 8px rgba(212, 175, 55, 0.4));
    transition: transform 0.3s ease;
}

footer img[alt="KingsLive Logo"]:hover {
    transform: scale(1.05);
}

/* Logo fallback - hide text if logo loads successfully */
nav img[alt="KingsLive Logo"] + h1 {
    display: none;
}

/* Show text if logo fails to load */
nav img[alt="KingsLive Logo"]:not([src]) + h1,
nav img[alt="KingsLive Logo"][src=""] + h1 {
    display: block;
}

/* Typed.js Cursor Customization */
.typed-cursor {
    opacity: 1;
    animation: typedjsBlink 0.7s infinite;
}

@keyframes typedjsBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Hide cursor during pause */
.typed-cursor.typed-cursor--blink {
    animation: typedjsBlink 0.7s infinite;
}



/* Safari Compatibility Fixes */
.hidden {
    display: none !important;
}

/* Student Verification Fields - Safari Compatible Animation */
#student-verification-fields {
    /* Enable smooth transitions */
    -webkit-transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0s linear 0s;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0s linear 0s;
    -webkit-transform: translateY(0);
    transform: translateY(0);
    will-change: opacity, transform;
}

#student-verification-fields.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    -webkit-transform: translateY(-10px);
    transform: translateY(-10px);
    /* Delay hiding visibility until after transition */
    -webkit-transition: opacity 0.3s ease-in, transform 0.3s ease-in, visibility 0s linear 0.3s;
    transition: opacity 0.3s ease-in, transform 0.3s ease-in, visibility 0s linear 0.3s;
}

#student-verification-fields:not(.hidden) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Safari-specific form fixes */
@supports (-webkit-appearance: none) {
    select.form-input {
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Force hardware acceleration for smoother animations */
    #student-verification-fields {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}


/* ===================================
   SAFARI COMPATIBILITY FIXES
   =================================== */

/* Safari Shake Animation Fallback */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* Safari Button Fixes */
@supports (-webkit-appearance: none) {
    button {
        -webkit-appearance: none;
        appearance: none;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }
    
    button:focus {
        outline: 2px solid #d4af37;
        outline-offset: 2px;
    }
    
    button:active {
        transform: scale(0.98);
    }
}

/* Safari Form Validation Styles */
input.border-red-500,
select.border-red-500,
textarea.border-red-500 {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

input.border-green-500,
select.border-green-500,
textarea.border-green-500 {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Safari-specific input fixes */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Safari touch event fixes */
* {
    -webkit-tap-highlight-color: transparent;
}

a, button, input, select, textarea {
    -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
}

/* NUCLEAR BUTTON HIDING - Overrides ALL inline styles and animations */
button#next-btn.hidden,
button#next-btn.force-hide,
button#next-btn[aria-hidden="true"],
#next-btn.hidden,
#next-btn.force-hide,
#next-btn[aria-hidden="true"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    cursor: default !important;
    z-index: -9999 !important;
}

/* Force Submit button to be visible when shown */
#submit-btn:not(.hidden),
#submit-btn.force-show {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
}

/* Show Next button by default */
#next-btn {
    display: inline-block;
    visibility: visible;
    opacity: 1;
}

/* Hide Next button when it has the .hidden class - use !important to override */
#next-btn.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

