/* ============================================
   KEDAI NYONYA - PASAR 8 MENU STYLES
   Warna Tema: Merah & Hijau Kopitiam
   Versi: 2.0 - Revisi Tabel & Responsif
============================================ */

/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #245952;
    color: #333;
    line-height: 1.6;
    padding-bottom: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   HEADER - WARNA MERAH
============================================ */
.header {
    background: #8f0000;
    color: white;
    padding: 30px 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(198, 40, 40, 0.2);
    position: relative;
    overflow: hidden;
    border: 4px solid;
}

.header:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 0;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.header h1 i {
    margin-right: 15px;
    font-size: 2.2rem;
}

.header .tagline {
    font-size: 1.3rem;
    font-style: italic;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.header p {
    margin-top: 15px;
    font-size: 1rem;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

/* ============================================
   FILTER BUTTONS
============================================ */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 25px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.filter-btn:hover {
    background-color: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(56, 142, 60, 0.3);
}

.filter-btn.active {
    background-color: #8f0000;
    box-shadow: 0 4px 8px rgba(198, 40, 40, 0.3);
	border: 4px solid;
}

.filter-btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.filter-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

/* ============================================
   CATEGORY - WARNA HIJAU
============================================ */
.category {
    background-color: #2e7d32;
    color: white;
    padding: 16px 20px;
    margin: 30px 0 15px 0;
    border-radius: 8px;
    font-size: 1.4rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.2);
	font-weight: 700;
}

.category i {
    margin-right: 12px;
    font-size: 1.3rem;
}

.category:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, #ffeb3b, #ff9800);
}

.category-description {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 5px;
    font-style: italic;
    width: 70%;
    padding-left: 32px; /* Untuk icon */
}

/* ============================================
   MENU TABEL - PERBAIKAN UTAMA
============================================ */
.menu-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 40px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    table-layout: fixed; /* FIX: Kolom lebar konsisten */
}

.menu-table th {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    padding: 18px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.menu-table th:nth-child(1) {
    width: 65%; /* FIX: Lebar kolom menu */
    padding-left: 25px;
}

.menu-table th:nth-child(2) {
    width: 35%; /* FIX: Lebar kolom harga */
    text-align: right;
    padding-right: 25px;
}

.menu-table td {
    padding: 18px 20px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    transition: background-color 0.2s ease;
}

.menu-table td:nth-child(1) {
    border-right: 1px solid #f0f0f0;
    padding-left: 25px;
    word-wrap: break-word; /* FIX: Teks panjang tidak keluar */
    overflow-wrap: break-word;
}

.menu-table td:nth-child(2) {
    text-align: right;
    padding-right: 25px;
    white-space: nowrap; /* FIX: Harga tetap satu baris */
}

.menu-table tr:last-child td {
    border-bottom: none;
}

.menu-table tr:hover td {
    background-color: #f9f9f9;
}

.menu-table tr:hover td:nth-child(1) {
    background-color: #f9f9f9;
}

/* ============================================
   MENU ITEM CONTENT
============================================ */
.menu-name-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

.menu-item-name {
    font-weight: 700;
    color: #1b5e20;
    font-size: 1.05rem;
    flex: 1;
    min-width: 200px;
}

.menu-item-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-top: 5px;
    max-width: 95%;
}

.price-column {
    font-weight: bold;
    color: #c62828;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 1.1rem;
    display: inline-block;
    padding: 4px 0;
}

/* ============================================
   WEEKEND BADGE
============================================ */
.weekend-badge {
    background: linear-gradient(135deg, #ff004b, #ffa951);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.weekend-item .menu-item-name {
    color: #e65100;
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */

/* Tablet & Small Desktop */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .category {
        font-size: 1.3rem;
        padding: 14px 18px;
    }
    
    .menu-table th,
    .menu-table td {
        padding: 16px 18px;
    }
    
    .menu-table th:nth-child(1),
    .menu-table td:nth-child(1) {
        padding-left: 20px;
    }
    
    .menu-table th:nth-child(2),
    .menu-table td:nth-child(2) {
        padding-right: 20px;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .header {
        padding: 25px 15px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header h1 i {
        font-size: 1.6rem;
        margin-right: 10px;
    }
    
    .header .tagline {
        font-size: 1.1rem;
    }
    
    .filter-buttons {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .filter-btn {
        padding: 10px 18px;
        font-size: 0.95rem;
    }
    
    .category {
        font-size: 1.2rem;
        padding: 12px 15px;
        margin: 25px 0 12px 0;
    }
    
    .category i {
        font-size: 1.1rem;
        margin-right: 10px;
    }
    
    .category-description {
        font-size: 0.9rem;
        padding-left: 26px;
    }
    
    /* FIX: Table untuk mobile */
    .menu-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        table-layout: auto; /* Biarkan auto di mobile */
    }
    
    .menu-table th,
    .menu-table td {
        padding: 14px 12px;
        min-width: 150px; /* Minimum width untuk mobile */
        font-size: 0.95rem;
    }
    
    .menu-table th:nth-child(1),
    .menu-table th:nth-child(2) {
        width: auto; /* Reset fixed width di mobile */
        min-width: 180px;
    }
    
    .menu-table td:nth-child(1) {
        min-width: 220px; /* Lebar minimum kolom menu */
        border-right: 1px solid #f0f0f0;
    }
    
    .menu-table td:nth-child(2) {
        min-width: 120px; /* Lebar minimum kolom harga */
        text-align: right;
    }
    
    .menu-item-name {
        font-size: 1rem;
        min-width: 150px;
    }
    
    .menu-item-description {
        font-size: 0.85rem;
        max-width: 100%;
    }
    
    .price-column {
        font-size: 1rem;
    }
    
    .weekend-badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .header .tagline {
        font-size: 1rem;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .category {
        font-size: 1.1rem;
        padding: 10px 12px;
    }
    
    .menu-table th,
    .menu-table td {
        padding: 12px 10px;
        font-size: 0.9rem;
    }
    
    .menu-table td:nth-child(1) {
        min-width: 200px;
    }
    
    .menu-table td:nth-child(2) {
        min-width: 100px;
    }
    
    .menu-item-name {
        font-size: 0.95rem;
        min-width: 130px;
    }
    
    .price-column {
        font-size: 0.95rem;
    }
}

/* ============================================
   FOOTER
============================================ */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 25px;
    color: #666;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.footer p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.footer strong {
    color: #c62828;
    font-size: 1rem;
}

.footer i {
    color: #4caf50;
    font-style: normal;
}

/* ============================================
   SCROLL TO TOP BUTTON (from JS)
============================================ */
#scrollToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #c62828;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
    z-index: 1000;
    display: none;
    transition: all 0.3s ease;
}

#scrollToTop:hover {
    background-color: #d32f2f;
    transform: translateY(-3px) scale(1.1);
}

/* ============================================
   PRINT STYLES
============================================ */
@media print {
    .filter-buttons,
    #scrollToTop {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .header {
        box-shadow: none;
        border-radius: 0;
        margin-bottom: 20px;
    }
    
    .menu-table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .footer {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background-color: white;
    }
}