@import url('https://fonts.googleapis.com/css2?family=Fredoka+One:wght@400&family=Open+Sans:wght@400;600;700&display=swap');

:root {
    /* Light Mode Colors */
    --bg-primary: linear-gradient(45deg, #FFE5B4, #FFB6C1, #E6E6FA, #FFFACD);
    --bg-white: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-light: #777777;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-bg-scrolled: rgba(255, 255, 255, 0.98);
    --card-bg: #ffffff;
    --modal-bg: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --shadow-dark: rgba(0, 0, 0, 0.3);
    
    /* Brand Colors (same in both modes) */
    --brand-red: #FF6B6B;
    --brand-orange: #FF8E53;
    --brand-pink: #FF6B9D;
    --brand-teal: #4ECDC4;
    --brand-blue: #45B7D1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    overflow-x: hidden;
    background: var(--bg-primary);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-orange) 25%, var(--brand-pink) 50%, #C44569 100%);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-medium);
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.1) 10px,
        rgba(255,255,255,0.1) 20px
    );
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% { transform: translateX(-50px); }
    100% { transform: translateX(50px); }
}

.header-content {
    text-align: center;
    position: relative;
    z-index: 3;
}

.logo {
    font-family: 'Fredoka One', cursive;
    font-size: 4rem;
    color: white;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.train-cars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    animation: trainMove 4s linear infinite;
}

@keyframes trainMove {
    0% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    100% { transform: translateX(-10px); }
}

.car {
    background: #FF4757;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 4px 8px var(--shadow-medium);
    position: relative;
}

.car::after {
    content: '●●';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #333;
}

.contact-quick {
    margin-top: 1rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Navigation Menu - UPDATED STYLES */
.main-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--brand-red);
    padding: 1rem 0;
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(255, 107, 107, 0.1);
}

.main-nav.scrolled {
    padding: 0.5rem 0;
    background: var(--nav-bg-scrolled);
    box-shadow: 0 4px 25px rgba(255, 107, 107, 0.2);
}

.nav-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Logo appears when scrolled */
.nav-logo {
    display: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.main-nav.scrolled .nav-logo {
    display: flex;
    align-items: center;
    opacity: 1;
    gap: 0.5rem;
}

.mini-train {
    font-size: 1.5rem;
    animation: mini-chug 3s ease-in-out infinite;
}

@keyframes mini-chug {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Updated nav-brand styles for individual letter animation */
.nav-brand {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: var(--brand-red);
    font-weight: 400;
    display: inline-block;
    white-space: nowrap;
    position: relative;
}

.main-nav.scrolled .nav-brand {
    font-size: 1.2rem;
}

/* Individual letter wave animation */
/* .letter-wave {
    display: inline-block;
    animation: letterBounce 1s ease-in-out infinite;
    animation-delay: calc(var(--letter-index) * 0.2s);
    transform-origin: bottom center;
    transition: all 0.2s ease;
} */

@keyframes letterBounce {
    0%, 5%, 10%, 15%, 20% {
        transform: translateY(0px) scale(1);
    }
    10% {
        transform: translateY(-8px) scale(1.1);
    }
    30% {
        transform: translateY(-4px) scale(1.05);
    }
    40% {
        transform: translateY(-2px) scale(1.02);
    }
    60% {
        transform: translateY(-6px) scale(1.08);
    }
    70% {
        transform: translateY(-3px) scale(1.04);
    }
    90% {
        transform: translateY(-1px) scale(1.01);
    }
}

/* Individual letter hover effects */
.main-nav.scrolled .letter-wave:hover {
    color: var(--brand-teal);
    transform: translateY(-3px) scale(1.2);
    text-shadow: 0 4px 8px rgba(78, 205, 196, 0.4);
}

/* Add color variation to letters */
.letter-wave:nth-child(odd) {
    color: var(--brand-red);
}

.letter-wave:nth-child(even) {
    color: var(--brand-orange);
}

.letter-wave:nth-child(3n) {
    color: var(--brand-pink);
}

/* Train tracks underneath */
.main-nav.scrolled .nav-brand::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        var(--brand-red) 0px,
        var(--brand-red) 6px,
        transparent 6px,
        transparent 10px
    );
    animation: trackMove 1.5s linear infinite;
    opacity: 0.6;
}

@keyframes trackMove {
    0% { transform: translateX(-10px); }
    100% { transform: translateX(0px); }
}

/* UPDATED NAVIGATION LINKS - COMPACT BUTTON STYLE */
.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    color: var(--brand-red);
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 0.9rem;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.2));
    border: 2px solid rgba(255, 107, 107, 0.3);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.nav-link:hover {
    background: linear-gradient(45deg, var(--brand-red), var(--brand-teal));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-link.active {
    background: linear-gradient(45deg, var(--brand-red), var(--brand-orange));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* Update scrolled navigation styles */
.main-nav.scrolled .nav-link {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    font-weight: 600;
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: var(--bg-white);
    margin: 2rem 0;
    border-radius: 30px;
    box-shadow: 0 20px 60px var(--shadow-light);
    position: relative;
    overflow: hidden;
}

@keyframes scroll {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-text h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    background: linear-gradient(45deg, var(--brand-red), #fc75a0, #ff5656, #cf79fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
    animation: textShimmer 3s ease-in-out infinite;
}

@keyframes textShimmer {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(45deg); }
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(45deg, var(--brand-red), #f375a1);
    color: white;
    padding: 1.2rem 2.5rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

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

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.4);
}

.hero-visual {
    text-align: center;
    position: relative;
}

.caboose-illustration {
    width: 100%;
    max-width: 400px;
    height: 300px;
    background: linear-gradient(135deg, #FF4757 0%, #FF3838 100%);
    border-radius: 20px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 20px 40px var(--shadow-medium);
    animation: sway 4s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
}

.caboose-illustration::before {
    content: '🚂';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    animation: chug 2s ease-in-out infinite;
}

@keyframes chug {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.1); }
}

.caboose-illustration::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 65%;
    background-image: 
        radial-gradient(ellipse at center, rgba(247, 70, 70, 0) 0%, rgba(0,0,0,0.7) 100%),
        url('https://icecreamcaboose.com/assets/images/ICC-img2.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 15px;
    opacity: .9;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3), 0 4px 10px var(--shadow-medium);
    border: 1px solid rgba(139, 69, 19, 0.6);
}

.wheels {
    position: absolute;
    bottom: -15px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
}

.wheel {
    width: 30px;
    height: 30px;
    background: #333;
    border-radius: 50%;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fun Stats Section */
.stats {
    padding: 4rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 2rem 0;
    border-radius: 30px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="30">🍨</text></svg>') repeat;
    opacity: 0.1;
    animation: float 10s ease-in-out infinite;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.stat-item {
    text-align: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item:hover .stat-number {
    animation-play-state: paused;
    transform: translateY(-2px) scale(1.1);
    text-shadow: 0 8px 16px rgba(255, 255, 255, 0.5);
}

.stat-number {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1;
    animation: statNumberFloat 3s ease-in-out infinite;
    transform-origin: center;
    transition: all 0.3s ease;
}

/* Individual stat animations with different delays */
.stat-item:nth-child(1) .stat-number {
    animation: statNumberFloat 3s ease-in-out infinite, countUp 2s ease-out;
    animation-delay: 0s, 0.5s;
}

.stat-item:nth-child(2) .stat-number {
    animation: statNumberFloat 3s ease-in-out infinite, countUp 2s ease-out;
    animation-delay: 0.5s, 1s;
}

.stat-item:nth-child(3) .stat-number {
    animation: statNumberFloat 3s ease-in-out infinite, countUp 2s ease-out;
    animation-delay: 1s, 1.5s;
}

.stat-item:nth-child(4) .stat-number {
    animation: statNumberFloat 3s ease-in-out infinite, countUp 2s ease-out;
    animation-delay: 1.5s, 2s;
}

@keyframes statNumberFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1);
        text-shadow: 0 4px 8px rgba(255, 255, 255, 0.3);
    }
    25% { 
        transform: translateY(-3px) scale(1.02);
        text-shadow: 0 6px 12px rgba(255, 255, 255, 0.4);
    }
    50% { 
        transform: translateY(0px) scale(1.05);
        text-shadow: 0 5px 10px rgba(255, 255, 255, 0.35);
    }
    75% { 
        transform: translateY(-2px) scale(1.01);
        text-shadow: 0 6px 12px rgba(255, 255, 255, 0.4);
    }
}

@keyframes countUp {
    0% { 
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-5px) scale(1.1);
    }
    100% { 
        opacity: 1;
        transform: translateY(0px) scale(1);
    }
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Fix alignment for infinity symbol */
.stat-item:last-child .stat-number {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    line-height: 1;
}

/* Menu Section */
.menu {
    padding: 4rem 0;
    background: var(--bg-white);
    margin: 2rem 0;
    border-radius: 30px;
    box-shadow: 0 20px 60px var(--shadow-light);
    position: relative;
    overflow: hidden;
}

.menu h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(45deg, var(--brand-red), var(--brand-teal), var(--brand-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.menu-card {
    background: linear-gradient(135deg, #FFE5B4 0%, #FFB6C1 100%);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transform: rotate(-2deg);
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px var(--shadow-light);
}

.menu-card:nth-child(even) {
    transform: rotate(2deg);
}

.menu-card:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 20px 40px var(--shadow-medium);
}

.menu-card h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: #FF4757;
    margin-bottom: 1rem;
}

.menu-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

/* Story Section */
.story {
    padding: 4rem 0;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    margin: 2rem 0;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
}

.story h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    text-align: center;
    color: #2d3436;
    margin-bottom: 3rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--brand-red), var(--brand-teal));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 2rem 0;
    animation: slideIn 0.8s ease-out;
}

.timeline-content {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px var(--shadow-light);
    width: 45%;
    position: relative;
    color: var(--text-primary);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 55%;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: 55%;
}

.timeline-year {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--brand-red);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 5px 15px var(--shadow-medium);
    z-index: 2;
}

/* Local Friends Section */
.local-friends {
    padding: 4rem 0;
    background: linear-gradient(135deg, #55a3ff 0%, #003d82 100%);
    margin: 2rem 0;
    border-radius: 30px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.friends-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.friends-title {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    margin-bottom: 2rem;
    color: white;
}

.friends-intro {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    opacity: 0.95;
}

.boulder-ridge-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 3rem;
    margin: 2rem 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.boulder-ridge-card:hover {
    transform: scale(1.02);
}

.boulder-ridge-card h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: #FFE5B4;
}

.boulder-ridge-card p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.perfect-day {
    background: linear-gradient(45deg, var(--brand-red), var(--brand-teal));
    color: white;
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 10px 25px var(--shadow-medium);
}

/* Contact Section */
.contact {
    padding: 4rem 0;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    margin: 2rem 0;
    border-radius: 30px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.contact h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    margin-bottom: 2rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.contact-card {
    background: rgba(255,255,255,0.2);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

.contact-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 2rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.footer-address {
    opacity: 0.8;
    font-size: 0.9rem !important;
}

/* Menu Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.299);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    position: relative;
    box-shadow: 0 20px 60px var(--shadow-dark);
    transform: scale(0.7) translateY(-50px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: var(--brand-red);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.modal-close:hover {
    background: #FF4757;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.modal-header {
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-teal) 100%);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
}

.modal-header h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.modal-body {
    padding: 2rem;
    text-align: center;
    max-height: calc(90vh - 120px);
    overflow: hidden;
}

.menu-frame {
    width: 100%;
    height: 70vh;
    min-height: 400px;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-medium);
    background: white;
}

/* Modal animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo { font-size: 2.5rem; }
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-text h2 { font-size: 2rem; }
    .cta-group { justify-content: center; }
    .timeline::before { left: 20px; }
    .timeline-content { width: calc(100% - 60px); margin-left: 60px !important; margin-right: 0 !important; }
    .timeline-year { left: 20px; transform: translateY(-50%); }
    
    .nav-content {
        flex-direction: column;
        gap: 0.5rem;
        justify-content: center;
    }
    
    /* Hide logo on mobile when not scrolled */
    .nav-logo {
        display: none !important;
    }
    
    /* Show logo on mobile when scrolled, but smaller */
    .main-nav.scrolled .nav-logo {
        display: flex !important;
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        opacity: 1;
        justify-content: center;
        margin-bottom: 0.5rem;
    }
    
    .main-nav.scrolled .nav-brand {
        font-size: 1rem;
        animation-duration: 3s; /* Slower on mobile for better performance */
    }
    
    .main-nav.scrolled .mini-train {
        font-size: 1.2rem;
        animation: mini-chug 2s ease-in-out infinite;
    }
    
    /* Mobile letter wave optimizations */
    .letter-wave {
        animation-duration: 3s; /* Slower on mobile for better performance */
    }
    
    /* Reduce bounce height on mobile */
    @keyframes letterBounce {
        0%, 20%, 50%, 80%, 100% {
            transform: translateY(0px) scale(1);
        }
        10% {
            transform: translateY(-4px) scale(1.05);
        }
        30% {
            transform: translateY(-2px) scale(1.02);
        }
        60% {
            transform: translateY(-3px) scale(1.04);
        }
        90% {
            transform: translateY(-1px) scale(1.01);
        }
    }
    
    /* Updated mobile navigation styles */
    .nav-links {
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
        letter-spacing: 0.2px;
    }
    
    .main-nav.scrolled .nav-content {
        flex-direction: column;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .main-nav.scrolled .nav-links {
        gap: 0.3rem;
        overflow-x: auto;
        white-space: nowrap;
        padding: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .main-nav.scrolled .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    .main-nav.scrolled .nav-link {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Reduce transform effects on mobile for better performance */
    .nav-link:hover {
        transform: translateY(-1px);
    }
    
    .nav-link.active {
        transform: translateY(-1px);
    }
    
    /* Mobile optimizations for stats animation */
    .stat-number {
        font-size: 2.5rem; /* Smaller on mobile */
        animation-duration: 4s; /* Slower for better performance */
    }
    
    .stat-item:hover {
        transform: translateY(-2px); /* Less movement on mobile */
    }
    
    /* Reduce bounce height on mobile stats */
    @keyframes statNumberFloat {
        0%, 100% { 
            transform: translateY(0px) scale(1);
            text-shadow: 0 2px 4px rgba(255, 255, 255, 0.3);
        }
        25% { 
            transform: translateY(-2px) scale(1.01);
            text-shadow: 0 3px 6px rgba(255, 255, 255, 0.4);
        }
        50% { 
            transform: translateY(0px) scale(1.02);
            text-shadow: 0 2px 4px rgba(255, 255, 255, 0.35);
        }
        75% { 
            transform: translateY(-1px) scale(1.01);
            text-shadow: 0 3px 6px rgba(255, 255, 255, 0.4);
        }
    }
    
    .footer-content p {
        font-size: 0.85rem;
    }
    
    /* Modal responsive */
    .modal-content {
        width: 95vw;
        max-height: 85vh;
        margin: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(85vh - 100px);
    }
    
    .menu-frame {
        height: 60vh;
        min-height: 300px;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: 10px;
        right: 15px;
    }
    
    /* Simplify on very small screens */
    @media (max-width: 480px) {
        .letter-wave {
            animation: none;
        }
        
        .main-nav.scrolled .nav-brand {
            animation: simpleWave 2s ease-in-out infinite;
        }
        
        @keyframes simpleWave {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-2px); }
        }
        
        .main-nav.scrolled .nav-brand::before {
            display: none;
        }
        
        /* Simplify stats animations on very small screens */
        .stat-number {
            animation: simpleStatFloat 3s ease-in-out infinite !important;
            font-size: 2.2rem;
        }
        
        @keyframes simpleStatFloat {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-1px); }
        }
        
        .stat-item:hover {
            transform: none; /* Disable hover on very small screens */
        }
    }
}

/* Desktop layout when scrolled */
@media (min-width: 769px) {
    .main-nav.scrolled .nav-content {
        justify-content: space-between;
        align-items: center;
    }
    
    .main-nav.scrolled .nav-links {
        margin-left: auto;
        margin-right: 0;
    }
}