/* Custom CSS for That's Amore Pizzeria - Classic Italian Restaurant Theme */

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #F5E6D3 0%, #FFF8DC 100%);
    color: #2C1810;
    width: 100%;
    max-width: 100vw;
}

/* Prevent horizontal scrolling only where needed */
.container, .max-w-7xl, .max-w-6xl, .max-w-4xl {
    max-width: 100%;
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
    .w-full {
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Prevent horizontal scrolling on mobile without interfering with vertical scroll */
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }
}

/* Classic Italian Restaurant Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(139, 0, 0, 0.03) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(139, 0, 0, 0.03) 2px, transparent 2px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* Typography */
.font-heading {
    font-family: 'Playfair Display', serif;
}

.font-body {
    font-family: 'Inter', sans-serif;
}

/* Navigation Styles */
.nav-link {
    @apply text-white hover:text-accent transition-colors duration-300 font-medium relative;
}

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

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

.mobile-nav-link {
    @apply block px-3 py-2 text-base font-medium text-white hover:text-accent hover:bg-white/10 rounded-md transition-colors duration-200;
}

/* Hero Section */
.typewriter-text {
    overflow: hidden;
    border-right: 3px solid #A31E22;
    white-space: nowrap;
    animation: typewriter 3s steps(40) infinite, blink-caret 0.75s step-end infinite;
}

/* Video Background Styles */
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* Enhanced text readability over video - removed text shadows for cleaner look */

/* Ensure video covers the entire hero section */
.hero-video-container {
    position: relative;
    overflow: hidden;
}

/* Video fallback and loading states */
.hero-video[poster] {
    object-fit: cover;
}

/* Voting Button States */
.vote-btn-ny:disabled,
.vote-btn-chicago:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.vote-btn-ny:disabled:hover,
.vote-btn-chicago:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Vote Confirmation and Error Messages */
.vote-confirmation,
.vote-error {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.8);
    transition: all 0.3s ease;
    z-index: 9999;
}

/* Mobile video optimization */
@media (max-width: 768px) {
    .hero-video {
        object-position: center;
    }
}

/* Video loading animation */
.hero-video:not([src]) {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-video[src] {
    opacity: 1;
}

/* Mobile-friendly typewriter */
@media (max-width: 768px) {
    .typewriter-text {
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }
}

/* Animated Background Elements */
.animate-gradient {
    background-size: 400% 400%;
    animation: gradient 8s ease infinite;
}

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

/* Battle Animation */
.animate-battle {
    animation: battle 2s ease-in-out infinite;
}

/* Interactive Poll Styles */
.vote-btn-ny, .vote-btn-chicago {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.vote-btn-ny:hover, .vote-btn-chicago:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.vote-btn-ny:active, .vote-btn-chicago:active {
    transform: scale(0.98);
}

.vote-btn-ny::before, .vote-btn-chicago::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.vote-btn-ny:hover::before, .vote-btn-chicago:hover::before {
    left: 100%;
}

/* Vote Counter Styles */
.vote-counter-ny, .vote-counter-chicago {
    transition: all 0.3s ease;
}

.vote-counter-ny:hover, .vote-counter-chicago:hover {
    transform: scale(1.05);
}

/* Progress Bar Styles */
.progress-bar {
    transition: width 1s ease-in-out;
}

/* Vote Confirmation Styles */
.vote-confirmation {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.8);
    transition: all 0.3s ease;
    animation: voteConfirmation 0.3s ease-out;
}

@keyframes voteConfirmation {
    0% {
        opacity: 0;
        transform: translate(-50%, -20px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

/* Poll Results Summary */
.poll-results {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(239, 68, 68, 0.1) 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.poll-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #3b82f6, #ef4444);
    border-radius: inherit;
    z-index: -1;
    opacity: 0.1;
}

/* Menu Cards */
.menu-card {
    transition: all 0.3s ease;
}

.menu-card:hover {
    transform: translateY(-8px);
}

/* Form Styles */
input:focus, textarea:focus {
    outline: none;
    border-color: #A31E22;
    box-shadow: 0 0 0 3px rgba(163, 30, 34, 0.1);
}

/* Button Hover Effects */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Scroll Animations */
[data-aos] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes typewriter {
    0%, 90%, 100% {
        width: 0;
    }
    30%, 60% {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #A31E22;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Battle Animation Keyframes */
@keyframes battle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        text-shadow: 0 0 20px rgba(163, 30, 34, 0.5);
    }
    25% {
        transform: scale(1.05) rotate(-1deg);
        text-shadow: 0 0 30px rgba(163, 30, 34, 0.8);
    }
    50% {
        transform: scale(1.1) rotate(0deg);
        text-shadow: 0 0 40px rgba(163, 30, 34, 1);
    }
    75% {
        transform: scale(1.05) rotate(1deg);
        text-shadow: 0 0 30px rgba(163, 30, 34, 0.8);
    }
}

/* Parallax Effects */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Hover Effects */
.hover-grow {
    transition: transform 0.3s ease;
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Clip Path Reveal */
.clip-reveal {
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.8s ease;
}

.clip-reveal.revealed {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Floating Elements */
.floating-element {
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(2) {
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    animation-delay: 4s;
}

/* Background Patterns */
.bg-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(163, 30, 34, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
}

/* Text Effects */
.text-glow {
    text-shadow: 0 0 20px rgba(163, 30, 34, 0.5);
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Card Animations */
.card-entrance {
    animation: cardEntrance 0.6s ease-out;
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Staggered Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Responsive Animations */
@media (max-width: 768px) {
    .animate-float {
        animation: none;
    }
    
    .parallax-bg {
        background-attachment: scroll;
    }
    
    .animate-battle {
        animation: battle 3s ease-in-out infinite;
    }
    
    .vote-confirmation {
        left: 1rem;
        right: 1rem;
        transform: none;
        width: auto;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #A31E22;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Smooth Transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

/* Focus States */
button:focus,
input:focus,
textarea:focus,
a:focus {
    outline: 2px solid #A31E22;
    outline-offset: 2px;
}

/* Floating Order Button - Ensure it displays correctly */
#floating-order {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    z-index: 9999 !important;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

#floating-order.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

#floating-order a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 80px !important;
    height: 80px !important;
    background-color: #A31E22 !important;
    color: white !important;
    border-radius: 50% !important;
    padding: 0 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
}

#floating-order a:hover {
    background-color: rgba(163, 30, 34, 0.9) !important;
    transform: scale(1.1) !important;
}

/* Accessibility */
@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 {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
}
