* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Krub', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 40%, #cc0000 70%, #4a0000 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Landing Page */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cover-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.logo img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.restaurant-name {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.opening-hours {
    font-size: 1.2rem;
    margin-bottom: 40px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.menu-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.menu-btn {
    width: 320px;
    padding: 25px 40px;
    font-size: 1.5rem;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.thai-menu {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.vietnamese-menu {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.menu-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.menu-icon {
    font-size: 2rem;
    margin-right: 10px;
}

.contact-info {
    font-size: 1.1rem;
    line-height: 1.8;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Flipbook Page with Entrance Animation */
.flipbook-page {
    display: none;
    padding: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flipbook-page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: flipbookEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes flipbookEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.flipbook-header {
    max-width: 1200px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.flipbook-header h2 {
    color: white;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.back-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid white;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.back-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.flipbook-container {
    max-width: 1200px;
    margin: 0 auto;
    perspective: 3000px;
    padding: 30px 20px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 20px;
}

/* Book shadow when displayed */
.turnbook {
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
}

.flipbook-controls {
    max-width: 1200px;
    margin: 20px auto 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
}

.control-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: white;
    color: #667eea;
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-indicator {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Turn.js Styles - Enhanced Flipbook */
.turnbook {
    width: 1000px;
    height: 700px;
    margin: 0 auto;
    position: relative;
}

.turnbook, .turnbook * {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.turnbook .page {
    background: white;
    box-shadow: 
        inset -3px -3px 10px rgba(0,0,0,0.1),
        inset 3px 3px 10px rgba(0,0,0,0.1),
        5px 5px 15px rgba(0,0,0,0.4);
    border-radius: 3px 8px 8px 3px;
}

.turnbook .page-wrapper {
    background: white;
    overflow: hidden;
}

.turnbook .page.odd {
    background: linear-gradient(to right, 
        #f5f5f5 0%, 
        #ffffff 5%, 
        #ffffff 95%, 
        #f5f5f5 100%);
    border-left: 1px solid #e0e0e0;
}

.turnbook .page.even {
    background: linear-gradient(to left, 
        #f5f5f5 0%, 
        #ffffff 5%, 
        #ffffff 95%, 
        #f5f5f5 100%);
    border-right: 1px solid #e0e0e0;
}

/* Enhanced page turning effects */
.turnbook .hard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.turnbook .own-size {
    box-shadow: 
        -5px 0 15px rgba(0,0,0,0.3),
        5px 0 15px rgba(0,0,0,0.3);
}

/* Page curl effect during turning */
.turnbook .page.\-1,
.turnbook .page.\-2 {
    box-shadow: 
        inset -3px -3px 10px rgba(0,0,0,0.2),
        -10px 10px 30px rgba(0,0,0,0.5),
        0 0 20px rgba(102, 126, 234, 0.3);
}

/* Active page highlight */
.turnbook .page.active {
    box-shadow: 
        0 0 30px rgba(102, 126, 234, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Page turning animation enhancement - FlipHTML5 Style */
.turnbook .page.turning {
    filter: brightness(1.05);
}

/* FlipHTML5-style page curl shadow during turn */
.turnbook .page.\-1::before,
.turnbook .page.\-2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0.1) 50%, 
        rgba(0,0,0,0.3) 100%);
    pointer-events: none;
    z-index: 10;
}

/* Enhanced 3D transform for FlipHTML5 feel */
.turnbook .page {
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

/* Smooth gradient transition on page turn */
.turnbook .peeling {
    box-shadow: 
        -5px 0 30px rgba(0,0,0,0.4),
        inset 0 0 40px rgba(0,0,0,0.1);
}

/* FlipHTML5-style highlight on active page */
.turnbook .page.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(255,255,255,0.1) 0%, 
        transparent 50%, 
        rgba(255,255,255,0.05) 100%);
    pointer-events: none;
    z-index: 5;
}

/* Center binding shadow for realistic book effect */
.turnbook.two-hard {
    box-shadow: 
        0 0 30px rgba(0,0,0,0.5),
        inset 0 0 50px rgba(0,0,0,0.2);
}

/* Hard cover thickness effect */
.turnbook .hard {
    box-shadow: 
        inset 5px 0 10px rgba(0,0,0,0.3),
        inset -5px 0 10px rgba(0,0,0,0.3),
        0 0 20px rgba(0,0,0,0.4);
}

/* Page edge highlights for realism */
.turnbook .page:not(.hard)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(255,255,255,0.9) 0%,
        rgba(220,220,220,0.4) 50%,
        rgba(255,255,255,0.9) 100%);
    pointer-events: none;
    opacity: 0.7;
    border-radius: 0 2px 2px 0;
}

/* Multiple page edges effect */
.turnbook .page:not(.hard)::before {
    content: '';
    position: absolute;
    top: 0;
    right: 2px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(255,255,255,0.6) 0%,
        rgba(200,200,200,0.2) 50%,
        rgba(255,255,255,0.6) 100%);
    pointer-events: none;
    opacity: 0.5;
}

/* Page texture overlay */
.turnbook .page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.menu-page-content {
    position: relative;
    z-index: 2;
}

/* Menu Page Content - Enhanced Flipbook Style */
.menu-page-content {
    padding: 25px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Cover Page Design - Hard Cover */
.cover-page.front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-page.back-cover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.hard .cover-design.hard-cover {
    text-align: center;
    padding: 40px;
    border: 4px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px) saturate(180%);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 60px rgba(0, 0, 0, 0.2),
        0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

/* Book spine effect on cover */
.book-spine {
    position: absolute;
    left: -20px;
    top: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(0,0,0,0.3) 0%, 
        transparent 100%);
    pointer-events: none;
}

/* Leather texture overlay for hard cover */
.hard .cover-design.hard-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.03) 2px,
            rgba(0,0,0,0.03) 4px
        );
    pointer-events: none;
    opacity: 0.5;
}

.cover-icon {
    font-size: 6rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.cover-title {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.cover-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-style: italic;
}

.cover-decoration {
    width: 120px;
    height: 4px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
    margin: 35px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* Inside Cover Design */
.inside-cover {
    background: linear-gradient(to right, #f8f9fa 0%, #ffffff 10%, #ffffff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.inside-cover-design {
    padding: 50px;
    text-align: center;
    border-left: 3px solid #e0e0e0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: 
        linear-gradient(to right, rgba(102, 126, 234, 0.05) 0%, transparent 20%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

.book-plate {
    width: 80px;
    height: 80px;
    border: 3px solid #667eea;
    border-radius: 50%;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.05) 100%);
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.2),
        inset 0 2px 5px rgba(255,255,255,0.8);
}

.book-plate::after {
    content: '🍜';
    font-size: 2.5rem;
}

.welcome-text h3 {
    font-family: 'Krub', sans-serif;
    font-weight: 600;
}

.welcome-text p {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Item Page Layout - HTML5 Flipbook Album Style */
.item-page {
    background: #fff;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.album-page {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.flipbook-album-image {
    max-width: 92%;
    max-height: 88%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 
        0 8px 30px rgba(0,0,0,0.25),
        0 0 0 8px rgba(255,255,255,0.9);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.flipbook-album-image:hover {
    transform: scale(1.03);
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.3),
        0 0 0 8px rgba(255,255,255,1);
}

.blank-page {
    background: #fafafa;
    height: 100%;
    width: 100%;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
}

.menu-grid-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.menu-grid-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.menu-grid-item h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 5px;
}

.menu-grid-item p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.menu-grid-item .price {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e74c3c;
}

/* Menu Section */
.menu-section {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .turnbook {
        width: 100% !important;
        height: 500px !important;
    }
    
    .turnbook .page {
        width: 100% !important;
        height: 500px !important;
    }
    
    .menu-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cover-icon {
        font-size: 4rem;
    }
    
    .cover-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .restaurant-name {
        font-size: 1.8rem;
    }
    
    .menu-btn {
        font-size: 1.2rem;
        padding: 15px 30px;
    }
    
    .flipbook-header h2 {
        font-size: 1.5rem;
    }
    
    .turnbook {
        height: 400px !important;
    }
    
    .turnbook .page {
        height: 400px !important;
    }
    
    .item-image-wrapper {
        padding: 10px;
    }
    
    .menu-item-image {
        max-height: 200px;
    }
    
    .item-name {
        font-size: 1.4rem;
    }
    
    .item-description {
        font-size: 0.95rem;
    }
    
    .item-price-tag {
        font-size: 1.3rem;
        padding: 6px 15px;
    }
    
    .cover-icon {
        font-size: 3rem;
    }
    
    .cover-title {
        font-size: 1.5rem;
    }
    
    .cover-subtitle {
        font-size: 1rem;
    }
}

/* Touch-friendly controls for mobile */
@media (max-width: 480px) {
    .control-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .back-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .flipbook-controls {
        gap: 10px;
    }
}

/* Print styles - hide flipbook when printing */
@media print {
    .flipbook-page,
    .flipbook-controls,
    .menu-buttons {
        display: none !important;
    }
}
