@import url('https://fonts.googleapis.com/css2?family=Shrikhand&family=Quicksand:wght@400;600;700&display=swap');

:root {
    /* Chrome & Comfort Palette */
    --c-cream: #FDF6E3;
    /* Background */
    --c-teal: #2ab7ca;
    /* Primary/Active, Unvisited Pins */
    --c-black: #1A1A1D;
    /* Text, Borders, Shadows */
    --c-red: #D9381E;
    /* Accents, Visited Pins */
    --c-yellow: #F2C94C;
    /* Accents */
    --c-silver: #E0E0E0;
    /* Chrome Accents */
    --c-neon-pink: #FF6EC7;
    /* Hover Glow */

    --header-font: 'Shrikhand', cursive;
    --body-font: 'Quicksand', sans-serif;

    --shadow-hard: 4px 4px 0px var(--c-black);
    --shadow-text: 2px 2px 0px var(--c-red);
}

body {
    padding-top: 86px;
    /* Increased to accommodate taller navbar (was 56px) */
    font-family: var(--body-font);
    background-color: var(--c-cream);
    color: var(--c-black);
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.brand-text {
    font-family: var(--header-font);
    font-weight: 400;
    /* Shrikhand is bold by nature */
    letter-spacing: 1px;
}

h1,
h2 {
    text-shadow: var(--shadow-text);
}

/* Flat Grey Navbar */
.navbar {
    background-color: var(--c-silver);
    /* #E0E0E0 */
    border-bottom: 4px solid var(--c-black);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Subtle shadow for depth without "bumper" feel */
}

.navbar-brand {
    color: var(--c-black) !important;
    font-size: 1.8rem;
    text-transform: uppercase;
    text-shadow: 2px 2px 0px var(--c-teal);
}

.navbar-logo {
    height: 60px;
    /* Bigger on desktop */
    width: auto;
    transition: height 0.3s ease;
    margin-left: 15px;
    /* Add breathing room */
}

.navbar-nav {
    align-items: center;
    /* Force vertical centering */
}

.nav-link {
    color: var(--c-black) !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.nav-link:hover {
    color: var(--c-red) !important;
}

/* Map & Sidebar Layout */
.home-container {
    height: calc(100vh - 56px);
    display: flex;
}

#sidebar {
    width: 380px;
    overflow-y: auto;
    background-color: var(--c-cream);
    border-right: 4px solid var(--c-black);
    display: flex;
    flex-direction: column;
}

#map {
    flex-grow: 1;
    height: 100%;
    z-index: 1;
}

/* Progress Bar */
.passport-status {
    background: var(--c-teal);
    color: var(--c-black);
    padding: 1.5rem;
    font-family: var(--header-font);
    border-bottom: 4px solid var(--c-black);
}

.progress {
    height: 14px;
    background-color: var(--c-cream);
    border: 2px solid var(--c-black);
    margin-top: 5px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--c-red);
}

/* Diner Cards (Coupon Style) */
.diner-list {
    padding: 1.5rem;
    background-color: var(--c-cream);
}

.diner-card {
    background: var(--c-cream);
    border: 2px dashed var(--c-black);
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    /* Coupon sharp edges or slight radius? Let's go slight */
    box-shadow: var(--shadow-hard);
    position: relative;
}

.diner-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--c-black);
    border-color: var(--c-neon-pink);
}

/* Unvisited state is default, but we can be explicit if needed */
.diner-card.unvisited {
    /* Explicitly inheriting or setting default cream background to ensure reset if toggled */
    background-color: var(--c-cream);
}

.diner-card.visited {
    background-color: white;
    border-style: solid;
    border-color: var(--c-black);
}

.card-body {
    padding: 1rem;
}

.card-title {
    font-family: var(--header-font);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--c-black);
}

.card-meta {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    border-top: 1px dotted var(--c-black);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.rating-stars {
    color: var(--c-yellow);
    text-shadow: 1px 1px 0px black;
}

.diner-thumb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    float: right;
    border: 2px solid var(--c-black);
    box-shadow: 2px 2px 0px var(--c-black);
    margin-left: 10px;
}

/* Buttons (Pill Shape High Gloss) */
.btn {
    border-radius: 9999px;
    border: 2px solid white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    font-family: var(--body-font);
    font-weight: 700;
    text-transform: uppercase;
    transition: transform 0.1s;
}

.btn:hover {
    transform: scale(1.05);
}

.btn-primary,
.btn-success {
    background: linear-gradient(to bottom, var(--c-teal) 0%, #158ca0 100%);
    color: white;
    border-color: white;
}

.btn-danger,
.spin-btn {
    background: linear-gradient(to bottom, var(--c-red) 0%, #a01200 100%);
    color: white;
    border-color: white;
}

/* "Dine-o-Rama" Wallbox Style */
.blueprint-container {
    min-height: calc(100vh - 56px);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--c-cream);
    padding: 40px 0;
}

.wallbox-chassis {
    position: relative;
    width: 800px;
    /* Increased for desktop */
    min-height: 600px;
    /* Reduced to fit viewport */
    height: auto;
    background-color: var(--c-teal);
    /* High-Gloss Vinyl Teal */
    border: 12px solid var(--c-red);
    /* Thick Ketchup Red Border */

    /* The "Hump" Shape: Rounded top, tighter bottom corners */
    /* User requested removing curve on desktop */
    border-radius: 30px;

    padding: 20px;
    /* Reduced padding */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Align top so it grows down */

    /* Deep Hard Shadow to pop off wall */
    box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.2), inset 10px 10px 20px rgba(255, 255, 255, 0.3);
    overflow: visible;
    /* Allow result to pop if needed, but radius clips inner */
}

.console-blueprint {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    /* Tighter padding */
    width: 100%;
    z-index: 2;
}

.dine-o-rama-header {
    font-family: var(--header-font);
    font-weight: 400;
    font-size: 3rem;
    color: white;
    /* White text on Teal */
    text-transform: capitalize;
    margin-bottom: 15px;
    /* Tightened */
    text-shadow: 4px 4px 0px var(--c-black);
    transform: rotate(-2deg);
    background: var(--c-red);
    padding: 5px 20px;
    border-radius: 4px;
    border: 2px solid var(--c-black);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

/* The Rotor Window */
/* The Rotor Window */
.wallbox-window {
    width: 100%;
    height: 150px;
    /* 3 items of 50px */
    background: #ffffff;
    border: 6px solid #E0E0E0;
    /* Chrome Silver Frame */
    border-radius: 10px;
    position: relative;
    margin-bottom: 20px;
    /* Tightened */
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    /* Deep inset */
    overflow: hidden;
    flex-shrink: 0;
    /* Prevent shrinking */
}

/* ... (helpers) ... */

.glass-reflection {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 10;
    border-radius: 8px;
}

.selection-bar {
    position: absolute;
    top: 50px;
    /* Centered in 150px */
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(217, 56, 30, 0.1);
    /* Subtle red highlight */
    border-top: 2px solid var(--c-red);
    border-bottom: 2px solid var(--c-red);
    z-index: 5;
    pointer-events: none;
}

.slot-reel-container {
    height: 100%;
    position: relative;
    z-index: 1;
}

#slot-strip {
    width: 100%;
}

/* Title Strips */
.title-strip-item {
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    background-color: #fdfdfd;
    /* Off-white paper */
    border-bottom: 1px solid #ddd;
    font-family: 'Courier Prime', monospace;
    font-weight: bold;
    color: var(--c-black);
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Strip Decor (Left Edge Geometric) */
.title-strip-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    /* Alternating red/green triangles pattern simulation */
    background-image: linear-gradient(45deg, #D9381E 25%, transparent 25%),
        linear-gradient(-45deg, #D9381E 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2ab7ca 75%),
        linear-gradient(-45deg, transparent 75%, #2ab7ca 75%);
    background-size: 10px 10px;
    background-color: #eee;
    border-right: 1px solid #ccc;
}

.ts-code {
    margin-left: 25px;
    /* Clear decor */
    margin-right: 10px;
    color: var(--c-red);
    font-weight: 700;
    font-family: sans-serif;
    font-size: 0.9rem;
}

.ts-name {
    flex-grow: 1;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.ts-price {
    font-size: 0.8rem;
    color: #888;
}

/* Button */
.wallbox-btn {
    background: var(--c-red);
    /* Hard Plastic Red */
    color: white;
    border: none;
    border-bottom: 6px solid #a01200;
    /* 3D depth */
    border-radius: 4px;
    /* Rectangular */
    /* width: 100%; */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    font-family: 'Shrikhand', cursive;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
    margin-bottom: 15px;
    /* Tightened */
}

.wallbox-btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Result Card */
.wallbox-result {
    /* margin-top: 20px; Not needed if flex spacing handles it, but let's keep it */
    background: var(--c-cream);
    padding: 10px;
    /* Reduced */
    border: 3px dashed var(--c-red);
    transform: rotate(1deg);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
    /* Ensure it doesn't break layout: */
    width: 100%;
}

.result-name {
    font-family: var(--header-font);
    font-size: 1.8rem;
    color: var(--c-black);
    margin-bottom: 5px;
}

/* --- Precision Star Rating --- */
.star-rating-wrapper {
    position: relative;
    display: inline-block;
    font-size: 1.2rem;
    line-height: 1;
    font-family: sans-serif;
    /* Ensure consistent width for both layers */
}

.stars-empty {
    color: #ccc;
}

.stars-filled {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;
    overflow: hidden;
    color: var(--c-red);
    /* Or #F2C94C for gold */
    width: 0%;
    /* Default, will be overridden by inline style */
}

/* Adjust sizes for different contexts */
.card-text .star-rating-wrapper {
    font-size: 1rem;
}


/* --- Leaderboard / Guest Check --- */

body.leaderboard-bg {
    background-color: var(--c-cream);
    /* Cream background to match app */
}

/* Nav Button */
.btn-nav-leaderboard {
    font-family: var(--body-font);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    background-color: #F2C94C;
    /* Mustard Yellow */
    color: var(--c-black);
    padding: 8px 16px;
    border: 2px solid var(--c-black);
    box-shadow: 4px 4px 0px var(--c-black);
    transition: all 0.1s ease;
    display: inline-block;
}

.btn-nav-leaderboard:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0px var(--c-black);
    color: var(--c-black);
}

.btn-nav-leaderboard:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--c-black);
}

/* Guest Check Receipt */
.guest-check-card {
    background-color: #E8F6EF;
    /* Mint */
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    padding: 40px 30px;
    position: relative;
    font-family: 'Courier Prime', monospace;
    color: #3B4D61;
    /* Carbon Blue */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    /* Slight rounding instead of jagged */

    /* Ruled Lines Background */
    background-image: repeating-linear-gradient(#E8F6EF 0px, #E8F6EF 29px, #d0e0d8 30px);
}

/* Header */
.check-header h1 {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    letter-spacing: 2px;
    margin: 0;
    text-align: center;
    border-bottom: 2px solid #3B4D61;
    padding-bottom: 15px;
}

.check-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    border-bottom: 2px solid #3B4D61;
    padding: 10px 0;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.check-meta-item strong {
    display: block;
    font-size: 0.7rem;
    opacity: 0.7;
}

.serial-no {
    color: #D9381E;
    font-family: 'Courier Prime', monospace;
    font-weight: bold;
    text-align: right;
    margin-top: 5px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* List Items */
.check-table {
    width: 100%;
    border-collapse: collapse;
}

/* 
.check-table th {
    text-align: left;
    border-bottom: 1px solid #3B4D61;
    padding: 5px;
    font-size: 0.8rem;
    text-transform: uppercase;
}
*/
.check-table td {
    padding: 12px 5px;
    vertical-align: top;
    border-bottom: 1px dashed rgba(59, 77, 97, 0.3);
}

.qty-col {
    width: 40px;
    text-align: center;
    font-weight: bold;
}

.price-col {
    width: 60px;
    text-align: right;
    font-weight: bold;
}

/* Handwritten Annotations */
/* Handwritten Annotations */
.handwritten-note {
    font-family: 'Permanent Marker', cursive;
    color: #D9381E;
    /* Red stamp look */
    font-size: 1.1rem;
    display: inline-block;
    position: relative;
    /* Not absolute */
    margin-left: 15px;
    opacity: 0.9;
    white-space: nowrap;
    vertical-align: middle;
}

/* Footer */
.check-footer {
    text-align: center;
    margin-top: 40px;
    font-family: 'Permanent Marker', cursive;
    font-size: 1.5rem;
    color: #3B4D61;
    opacity: 0.8;
}

/* Mechanical Button */
.mechanical-btn {
    background: var(--c-cream);
    border: 4px solid var(--c-black);
    font-family: impact, sans-serif-condensed, sans-serif;
    font-size: 1.5rem;
    padding: 0;
    /* Remove padding, use width/height or flex centering */
    width: 280px;
    height: 70px;
    cursor: pointer;
    position: relative;
    box-shadow: 8px 8px 0px var(--c-black);
    transition: all 0.1s;
    overflow: hidden;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mechanical-btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 10px 10px 0px var(--c-black);
}

.mechanical-btn:active:not(:disabled),
.mechanical-btn:disabled {
    transform: translate(4px, 4px);
    box-shadow: 2px 2px 0px var(--c-black);
    /* Keep it pressed when disabled (spinning) */
    background-color: #f0ebd6;
}

/* Result Details */
#result-details {
    text-align: center;
    background: white;
    padding: 15px;
    border: 2px dashed var(--c-black);
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#result-details.visible {
    opacity: 1;
}

#result-address {
    font-family: var(--body-font);
    font-weight: 600;
    margin-bottom: 10px;
}


/* Custom Popups */
.leaflet-popup-content-wrapper {
    border-radius: 0;
    border: 2px solid var(--c-black);
    box-shadow: var(--shadow-hard);
    background: var(--c-cream);
    font-family: var(--body-font);
}

.leaflet-popup-tip {
    background: var(--c-black);
}

/* Lightbox Modal */
#image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

#image-modal.active {
    display: flex;
}

#modal-img {
    max-width: 90vw;
    max-height: 85vh;
    border: 8px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    /* Slight photo rounding */
    object-fit: contain;
}

#modal-close-btn {
    margin-top: 20px;
    padding: 10px 30px;
    font-size: 1.2rem;
    font-family: var(--header-font);
    cursor: pointer;
    background: var(--c-red);
    color: white;
    border: 2px solid white;
    border-radius: 999px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s;
}

#modal-close-btn:hover {
    transform: scale(1.05);
    background: #ff4d4d;
}

#modal-close-btn:active {
    transform: scale(0.95);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {

    /* 1. Main Layout (Sidebar & Map) */
    .home-container {
        flex-direction: column-reverse;
        /* Map on Top (Stacking order: Sidebar, Map -> Map, Sidebar) */
        height: calc(100vh - 56px);
        /* Maintain full height logic */
    }

    #map {
        height: 50vh;
        /* Map takes 50% vertical space */
        width: 100%;
        flex-grow: 0;
        /* Stop it from expanding beyond 50vh automatically */
    }

    #sidebar {
        width: 100%;
        /* Full width */
        height: 50vh;
        /* Remaining 50% */
        border-right: none;
        border-top: 4px solid var(--c-black);
        /* Separator moved to top */
    }

    /* 2. Jukebox Randomizer */
    .blueprint-container {
        padding: 20px 0;
        /* Reduced padding */
    }

    .jukebox-blueprint {
        width: 95%;
        /* Fluid width */
        height: auto;
        /* Fluid height */
        /* Maintain aspect ratio somewhat or allow stretching */
        min-height: 500px;
        border-radius: 40px 40px 10px 10px;
        /* Reduced curves */
        padding: 15px;
    }

    .console-blueprint {
        padding: 0 10px;
        /* Reduced padding */
    }

    .mechanical-btn {
        width: 100%;
        /* Full width button */
        max-width: 300px;
    }

    .dine-o-rama-header {
        font-size: 2.5rem;
        /* Smaller header */
        margin-top: 2rem;
    }

    /* SVG Scaling logic might need JS or viewBox tweaks, 
       but setting SVG width to 100% handles most */

    /* 3. UI Components */
    .navbar-brand {
        font-size: 1.4rem;
    }

    #image-modal {
        padding: 10px;
    }

    #modal-img {
        max-width: 95vw;
        max-height: 80vh;
        border-width: 4px;
        /* Thinner border */
    }

    /* 4. Compact Mobile Popups */
    .leaflet-popup-content-wrapper {
        padding: 5px !important;
        border-radius: 4px;
    }

    .leaflet-popup-content {
        margin: 8px !important;
        width: 240px !important;
        /* Constrain width */
        min-width: unset !important;
    }

    /* Target Elements inside Popup (using !important to override inline JS styles) */
    .leaflet-popup-content h4 {
        font-size: 1.1rem !important;
        margin-bottom: 2px !important;
    }

    .leaflet-popup-content p {
        font-size: 0.8rem !important;
        margin-bottom: 4px !important;
    }

    .leaflet-popup-content span {
        font-size: 1rem !important;
        /* Smaller stars */
    }

    /* Shrink the grid of scores */
    .leaflet-popup-content div[style*="grid"] {
        gap: 2px !important;
        font-size: 0.7rem !important;
    }

    /* Replace Image with Button on Mobile */
    .leaflet-popup-content .popup-img-desktop {
        display: none !important;
    }

    .leaflet-popup-content .popup-btn-mobile {
        display: block !important;
    }

    /* Clear float container if we float image */
    .leaflet-popup-content::after {
        content: "";
        display: table;
        clear: both;
    }
}

/* Sidebar Search Input */
#diner-search {
    border: 2px solid var(--c-black);
    border-radius: 0;
    padding: 12px;
    font-family: var(--body-font);
    font-weight: 600;
    color: var(--c-black);
    background-color: white;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

#diner-search:focus {
    border-color: var(--c-teal);
    box-shadow: 4px 4px 0px var(--c-teal);
    outline: none;
    transform: translate(-1px, -1px);
}

#diner-search::placeholder {
    color: #999;
    font-weight: 400;
}

/* Retro Nav Button (Dine-o-Rama) */
.btn-nav-retro {
    background-color: var(--c-red);
    color: white !important;
    font-family: var(--body-font);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    padding: 8px 20px;
    border: 2px solid var(--c-black);
    border-radius: 0;
    box-shadow: 4px 4px 0px var(--c-black);
    transition: all 0.1s ease;
    display: inline-block;
    line-height: 1.5;
}

.btn-nav-retro:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0px var(--c-black);
    color: white !important;
}

.btn-nav-retro:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--c-black);
}