/* --- Modern CSS Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Modern, Bold & Poppy Theme --- */
:root {
    /* A vibrant, modern color palette */
    --brand-blue: #3070C5;    /* Primary actions */
    --brand-green: #30D158;   /* Go, success */
    --brand-red: #FF453A;     /* Stop, alert */
    --brand-purple: #AF52DE;  /* Accent for distance, etc. */
    
    /* Clean, high-contrast text and UI colors */
    --text-dark: #1c1c1e;
    --text-light: #636366;
    --ui-background: #ffffff;
    --ui-light-gray: #f2f2f7;
    --ui-border: #d1d1d6;

    /* Softer, more modern UI metrics */
    --border-radius-large: 24px;
    --border-radius-medium: 16px;
    --shadow-soft: 0 8px 24px rgba(0,0,0,0.12);
}

body { 
    margin: 0; 
    padding: 0; 
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 700;
    overflow: hidden;
    background-color: var(--ui-light-gray);
}
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}
.hidden { display: none !important; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
/* The arrow marker's SVG is now rotated 180deg so its "up" is its base */
.arrow-marker {
    animation: pulse 2s infinite ease-in-out;
}

.poi-marker {
    background-color: var(--ui-background);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 2px solid white;
    cursor: pointer;
}
/* --- POI Marker Icon Styling --- */
.poi-marker .poi-icon {
    width: 24px; /* Adjust this to properly fill the 40px bubble */
    height: 24px;
    object-fit: contain;
}
    
/* --- Toast Notification --- */
#toast-container {
    position: fixed; top: 20px; left: 50%;
    transform: translateX(-50%); z-index: 9999;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.toast-message {
    padding: 12px 20px; background-color: var(--brand-red); color: white;
    font-weight: 800; border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-soft);
    animation: fadeInOut 3s ease-in-out forwards;
}
.toast-message.toast-success {
    background-color: var(--brand-green);
}
@keyframes fadeInOut {
    0%, 100% { opacity: 0; transform: translateY(-20px); }
    10%, 90% { opacity: 1; transform: translateY(0); }
}

/* --- Loading Overlay --- */
#loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9998; display: flex; flex-direction: column;
    justify-content: center; align-items: center; backdrop-filter: blur(5px);
}
.loader-spinner {
    border: 5px solid var(--ui-light-gray);
    border-top: 5px solid var(--brand-purple);
    border-radius: 50%; width: 50px; height: 50px;
    animation: spin 1s linear infinite;
}
#loader-message {
    margin-top: 20px; font-size: 1.2em; font-weight: 800; color: var(--text-dark);
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Desktop Controls --- */
#controls {
    position: absolute; z-index: 1;
    background: var(--ui-background);
    padding: 16px; border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-soft);
    top: 70px; 
    left: 10px; 
    display: flex; flex-direction: column; gap: 12px;
}
.input-container { position: relative; display: flex; align-items: center;}
#controls input {
    padding: 12px 16px; border: 1px solid var(--ui-border);
    border-radius: var(--border-radius-large); width: 280px;
    font-size: 1em; font-family: 'Nunito'; font-weight: 700;
    transition: border-color: 0.2s, box-shadow 0.2s;
}
#controls input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}

.clear-input-btn {
    position: absolute; right: 12px; background: #ccc; border: none;
    border-radius: 50%; width: 20px; height: 20px; cursor: pointer;
    font-weight: bold; color: white; display: flex;
    align-items: center; justify-content: center;
}

#getRouteBtn {
    padding: 14px 12px; border: none; background-color: var(--brand-green);
    color: white; cursor: pointer; border-radius: var(--border-radius-large);
    font-size: 1.2em; font-weight: 800; margin-top: 10px;
    transition: background-color 0.2s, transform 0.1s;
}
#getRouteBtn:active { transform: scale(0.98); }
#getRouteBtn:disabled {
    background-color: #9E9E9E; cursor: not-allowed; opacity: 0.7;
}

/* --- Autocomplete Results --- */
.autocomplete-results {
    position: absolute; background-color: var(--ui-background);
    border: 1px solid var(--ui-border); z-index: 1000; width: 100%;
    box-sizing: border-box; border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-soft); overflow: hidden; top: calc(100% + 4px);
}
.autocomplete-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; cursor: pointer; border-bottom: 1px solid #eee;
}
.autocomplete-item-main { min-width: 0; }
.autocomplete-title {
    font-weight: 800; font-size: 1.1em; color: var(--text-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.autocomplete-address {
    font-size: 0.9em; color: var(--text-light); margin-top: 2px;
    font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.autocomplete-distance {
    font-size: 0.9em; font-weight: 700; color: var(--brand-purple);
    flex-shrink: 0; margin-left: 10px;
}
/* --- Map Price Markers --- */
/* --- Map Price Markers (White Bubble Style) --- */
.poi-marker.price-marker {
    /* 1. Keep the white background and border from .poi-marker */
    background-color: var(--ui-background);
    border: 2px solid white;

    /* 2. Change text color to black */
    color: var(--text-dark);
    
    /* 3. Make it a "pill" to fit the text */
    width: auto; /* Auto-width based on content */
    height: 36px; /* A consistent height */
    border-radius: 18px; /* Pill shape (height / 2) */
    padding: 0 10px; /* Horizontal padding for the text */

    /* 4. Make text smaller and bolder to fit */
    font-size: 16px;
    font-weight: 800;
    
    /* 5. Keep the shadow */
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* --- POI List Price Styling --- */
.autocomplete-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: 12px;
    text-align: right;
}
.poi-list-price {
    font-size: 1.1em;
    font-weight: 800;
    color: var(--brand-green);
    margin-bottom: 4px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.highlighted { background-color: var(--ui-light-gray); }

/* --- Navigation UI (CLEANED) --- */
#navigation-ui {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 5;
    background: var(--ui-background);
    padding: 12px 16px; /* Adjusted padding */
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 16px; /* Adjusted gap */
}
    
#next-step-content {
    flex-grow: 1;
    min-width: 0; /* Prevents text overflow issues */
    text-align: center; /* Center the text */
}
#step-distance {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
}
#step-instruction {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#view-steps-btn {
    background: var(--ui-light-gray);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--text-dark);
}

/* --- REFACTOR: Made stop button red for clear UX --- */
#stop-nav-btn {
    background: var(--brand-red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

#navigation-summary-ui {
    position: absolute;
    bottom: 10px; left: 10px; right: 10px;
    z-index: 5;
    background: var(--ui-background);
    padding: 12px 16px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-soft);
    display: flex; justify-content: space-around; text-align: center;
}
.summary-value { font-size: 1.8em; font-weight: 800; color: var(--text-dark); line-height: 1; }
.summary-label { font-size: 1em; color: var(--text-light); margin-top: 4px; }
    
/* --- Instruction List Modal --- */
#instruction-list-modal {
    position: fixed; bottom: 0; left: 0; right: 0; height: 60%;
    background: var(--ui-background); z-index: 20;
    border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    transform: translateY(100%); transition: transform 0.3s ease-in-out;
    display: flex; flex-direction: column;
}
#instruction-list-modal.visible { transform: translateY(0); }
#instruction-list-header {
    padding: 16px; text-align: center; font-size: 1.4em; font-weight: 800;
    position: relative; border-bottom: 1px solid var(--ui-border);
}
#instruction-list-header::before {
    content: ''; display: block; width: 40px; height: 5px;
    background-color: #ccc; border-radius: 3px; margin: -4px auto 10px;
}
#instruction-list-container { overflow-y: auto; flex-grow: 1; padding: 0 8px; }
.instruction-item {
    display: flex; padding: 16px 8px; border-bottom: 1px solid var(--ui-border); align-items: center;
}
.instruction-text { flex-grow: 1; font-size: 1.1em; font-weight: 700; }
.instruction-distance { font-size: 1em; font-weight: 800; color: var(--text-light); }
.modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); z-index: 19;
}

#reroute-indicator {
    position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
    background: rgba(255, 100, 0, 0.9); color: white; padding: 8px 15px;
    border-radius: var(--border-radius-large); z-index: 2; font-weight: bold;
}
#attribution {
    position: absolute; bottom: 5px; right: 5px; z-index: 1000;
    background: rgba(255, 255, 255, 0.7); padding: 2px 5px;
    font-size: 12px; border-radius: 2px;
}
    
/* --- Shared Controls --- */
.map-control-button {
    position: absolute; z-index: 1; background: var(--ui-background); border: none;
    border-radius: 50%; box-shadow: var(--shadow-soft);
    width: 48px; height: 48px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    box-sizing: border-box; 
}
#recenter-button {
    bottom: 90px; right: 10px;
}

/* --- Menu Icon Styles --- */
#menu-icon-btn {
    top: 10px;
    left: 10px;
    z-index: 5;
    border: 2px solid var(--text-dark);
}
    
#mobile-search-ui { display: none; }

/* --- Mobile Specific Styles --- */
@media screen and (max-width: 768px) {
    #controls { 
        display: none; 
        top: 70px;
    }
    #navigation-ui {
        left: 10px; /* Match screen edge */
    }

    #search-bar-container {
        display: block; position: fixed; z-index: 10;
        bottom: 10px; left: 10px; right: 10px;
        background: var(--ui-background); border-radius: var(--border-radius-large);
        box-shadow: var(--shadow-soft); padding: 15px 20px;
        font-size: 1.4em; color: var(--text-dark); text-align: center;
        cursor: pointer; font-weight: 800; transition: transform 0.2s;
    }
    #search-bar-container:active { transform: scale(0.98); }
        
    #mobile-search-ui {
        display: flex; flex-direction: column; position: fixed; z-index: 15;
        top: 0; left: 0; width: 100%; height: 100%; background: var(--ui-background);
        transform: translateY(100%); transition: transform 0.3s ease-in-out; pointer-events: none;
        border-radius: 0; /* Full screen panel has no radius */
    }
    #mobile-search-ui.visible { transform: translateY(0); pointer-events: auto; }

    #search-menu-header {
        padding: 10px 15px; display: flex; align-items: center;
        border-bottom: 1px solid var(--ui-border); flex-shrink: 0; background: var(--ui-background);
        padding-left: 70px;
        position: relative;
        min-height: 48px;
    }
    #close-search-btn { 
        background: none; border: none; cursor: pointer; padding: 5px; 
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
    }

    #search-view { display: flex; flex-direction: column; background: var(--ui-background); }
    #search-inputs-container { padding: 0 15px; }
    #search-inputs-container .input-container { margin-top: 15px; }
    #search-inputs-container input {
        width: 100%; box-sizing: border-box; padding: 16px 40px 16px 16px; font-size: 16px; 
        border-radius: var(--border-radius-medium); border: 1px solid var(--ui-border);
        font-family: 'Nunito'; font-weight: 700;
    }
    #mobile-search-ui .autocomplete-results {
        position: absolute; top: 100%; left: 0; right: 0;
        margin-top: 4px; border-radius: var(--border-radius-medium);
    }

    #search-categories {
        padding: 15px 0 15px 15px; display: flex; overflow-x: auto;
        white-space: nowrap; -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid var(--ui-border); scrollbar-width: none;
    }
    #search-categories::-webkit-scrollbar { display: none; } 

    /* --- Updated Category Button Styles --- */
.category-btn {
    /* Use flexbox to align icon and text */
    display: flex;
    align-items: center;
    justify-content: center; /* Center text for text-only buttons */
    gap: 8px; /* Space between icon and text */

    padding: 10px 18px;
    border-radius: var(--border-radius-large);
    background-color: var(--ui-light-gray);
    border: 1px solid var(--ui-border);
    margin-right: 10px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s, background-color 0.1s;
}

/* This resets justify-content if an icon is present */
.category-btn img.category-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.category-btn img.category-icon + span {
    justify-content: flex-start;
}

.category-btn:active { 
    transform: scale(0.96); 
    background-color: #e2e6ea; 
}
    #category-results-panel, #route-overview-mobile, #poi-detail-panel {
        position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--ui-background);
        border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    }

    #category-results-panel {
        height: 90%; max-height: 90%; transform: translateY(100%);
        transition: transform 0.4s ease-in-out; z-index: 16;
        display: flex; flex-direction: column;
    }
    #category-results-panel.visible { transform: translateY(calc(100% - 250px)); }
    #category-results-panel.expanded { transform: translateY(10%); }

    #panel-handle {
        width: 40px; height: 5px; background-color: #ccc;
        border-radius: 3px; margin: 10px auto;
        cursor: grab; touch-action: none;
    }
    #panel-header {
        font-size: 1.4em; font-weight: 800; text-align: center;
        padding: 0 15px 10px; border-bottom: 1px solid var(--ui-border);
        position: relative; min-height: 38px; display: flex;
        align-items: center; justify-content: center;
    }
    #category-back-btn {
        position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
        background: none; border: none; cursor: pointer; padding: 5px;
    }
    #category-results-list { overflow-y: auto; flex-grow: 1; }
        
    #route-overview-mobile {
        padding: 15px 20px 20px; z-index: 17;
    }
    .overview-top-bar { display: flex; align-items: center; gap: 15px; margin-bottom: 5px; }
    #overview-back-btn {
        position: relative; flex-shrink: 0; background: var(--ui-light-gray); border: none;
        border-radius: 50%; width: 40px; height: 40px;
        display: flex; align-items: center; justify-content: center; cursor: pointer;
    }
        
    .overview-header { display: flex; align-items: baseline; gap: 10px; }
    .overview-time { font-size: 2.2em; font-weight: 800; }
    .overview-distance { font-size: 1.2em; color: var(--text-light); }
    .overview-summary { font-size: 1.5em; font-weight: 800; margin-top: 4px; }
    .overview-description { font-size: 1em; color: var(--text-light); font-weight: 400; margin-top: 2px; }
    #startNavBtn-mobile {
        width: 100%; padding: 16px 12px; border: none; color: white;
        cursor: pointer; border-radius: var(--border-radius-large);
        font-size: 1.4em; font-weight: 800; margin-top: 20px;
        background-color: var(--brand-blue); transition: transform 0.1s;
    }
    #startNavBtn-mobile:active { transform: scale(0.98); }
        
    /* --- POI Detail Panel (REDESIGNED) --- */
    #poi-detail-panel {
        height: 85%;
        max-height: 85%;
        transform: translateY(100%);
        transition: transform 0.4s ease-in-out;
        z-index: 18; /* Higher than category panel */
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        background: var(--ui-background);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
    }
    #poi-detail-panel.visible { transform: translateY(0); }

    #poi-detail-header {
        flex-shrink: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        padding: 10px 20px 15px;
        border-bottom: 1px solid var(--ui-border);
    }
    #poi-detail-header #panel-handle {
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 5px;
        background-color: #ccc;
        border-radius: 3px;
    }

    #poi-detail-back-btn {
        background: none; border: none; font-size: 1em;
        font-weight: 700; color: var(--brand-blue);
        cursor: pointer; padding: 0;
        font-family: 'Nunito', sans-serif; 
    }
    #poi-edit-btn {
        background: var(--ui-light-gray); border: 1px solid var(--ui-border); 
        color: var(--brand-blue); font-weight: 700;
        padding: 6px 14px; border-radius: var(--border-radius-large);
        cursor: pointer; font-size: 0.9em;
        font-family: 'Nunito', sans-serif; 
    }

    #poi-detail-content { 
        flex-grow: 1; 
        overflow-y: auto;
        padding: 20px;
    }
        
    #poi-primary-info { margin-bottom: 15px; }

    #poi-detail-name {
        font-size: 1.8em;
        font-weight: 800;
        margin: 0 0 8px 0;
        color: var(--text-dark);
        line-height: 1.2;
    }
        
    #poi-detail-category {
        display: inline-block;
        font-size: 0.9em;
        font-weight: 700;
        color: var(--brand-purple);
        background-color: #f2eafb;
        padding: 4px 12px;
        border-radius: var(--border-radius-large);
        margin: 0 0 12px 0;
    }

    #poi-detail-address {
        font-size: 1em;
        color: var(--text-light);
        margin: 0;
        font-weight: 400;
    }
        
    .poi-content-divider {
        border: none;
        height: 1px;
        background-color: var(--ui-border);
        margin: 0 0 20px 0;
    }
        
    #poi-detail-loader {
        font-size: 0.95em;
        color: var(--text-light);
        margin-top: 10px;
        font-weight: 700;
    }
        
    /* --- Read-Only Display Styles (REFACTORED for simpler UX) --- */
    .detail-display-group { 
        margin-top: 18px;
    }
    .detail-display-group .display-label,
    .detail-edit-group .edit-label { /* Shared label style */
        font-size: 0.8em;
        font-weight: 700;
        color: var(--text-light);
        margin-bottom: 2px; /* Reduced margin */
        display: block;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    /* --- REFACTOR: This is the main UX change --- */
    /* Removed the gray box for a cleaner, scannable label/value pair */
    #poi-details-display .detail-display-group .display-value {
        font-size: 1.1em;
        font-weight: 700;
        color: var(--text-dark);
        padding: 4px 0 0 0; /* Changed padding */
        min-height: 20px;
        white-space: pre-wrap;
        word-break: break-word;
        /* Removed background and border */
    }
    /* Special handling for gas prices to keep them boxed */
    #poi-details-display .gas-price-display-grid .display-value {
        font-size: 1em; /* Keep price font size normal */
        font-weight: 700;
        color: var(--text-dark);
        padding: 12px 14px;
        border-radius: var(--border-radius-medium);
        background: var(--ui-light-gray);
        border: 1px solid var(--ui-border);
    }
    
    #poi-details-display .detail-display-group .display-value.empty {
        color: var(--text-light);
        font-style: italic;
        font-weight: 400;
        background: none; /* Ensure empty also has no background */
        border: none;
        padding: 4px 0 0 0;
    }

    /* --- Playful Editable Field Styles (Unchanged) --- */
    .detail-edit-group {
        margin-top: 18px;
    }
    .detail-edit-group input,
    .detail-edit-group textarea {
        width: 100%;
        box-sizing: border-box;
        padding: 12px 14px;
        border-radius: var(--border-radius-medium);
        border: 1px solid var(--ui-border);
        font-family: 'Nunito', sans-serif;
        font-weight: 700;
        font-size: 1em;
        background: var(--ui-light-gray);
        -webkit-appearance: none;
        transition: all 0.2s;
    }
    .detail-edit-group input:focus,
    .detail-edit-group textarea:focus {
        outline: none;
        border-color: var(--brand-blue);
        background-color: var(--ui-background);
        box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
    }
    .detail-edit-group textarea { 
        min-height: 80px; 
        resize: vertical; 
    }
        
    /* --- Category-Specific Styles (Unchanged) --- */
    .category-panel-divider {
        border: 0; height: 1px; background-color: var(--ui-border);
        margin: 20px 0;
    }
    .category-section-title {
        font-size: 1.1em; font-weight: 800; color: var(--text-dark);
        margin-top: 20px; margin-bottom: 5px;
    }
    /* Gas Station Price Grid */
    .gas-price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .gas-price-grid .detail-edit-group { margin-top: 0; }
    .gas-price-display-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .amenity-pill-display {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--border-radius-large);
    font-size: 0.9em;
    font-weight: 700;
    background-color: var(--ui-light-gray);
    border: 1px solid var(--ui-border);
    margin: 4px 4px 0 0;
}
.amenity-tag-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.amenity-tag-input-group input {
    flex-grow: 1;
    min-width: 0;
    /* Uses the existing input styles, which is good */
}
.add-tag-btn {
    flex-shrink: 0;
    padding: 0 16px;
    border: none;
    background: var(--brand-blue);
    color: white;
    font-weight: 700;
    font-size: 0.9em;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    transition: background-color 0.2s;
}
.add-tag-btn:active {
    background-color: #2a62aa;
}
.amenity-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* A single removable pill */
.amenity-pill {
    display: inline-flex;
    align-items: center;
    background: var(--brand-purple);
    color: white;
    border-radius: var(--border-radius-large);
    padding: 6px 8px 6px 12px;
    font-size: 0.9em;
    font-weight: 700;
    animation: popIn 0.2s ease-out;
}
.amenity-pill span {
    margin-right: 6px;
}
.remove-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    font-size: 14px;
}
.remove-pill-btn:hover {
    background: rgba(0,0,0,0.2);
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
    /* Restaurant/Park/Shop Amenities & Displays */
    .amenity-display-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
    .amenity-display-item {
        display: inline-flex; align-items: center; gap: 6px;
        padding: 6px 12px; border-radius: var(--border-radius-large);
        font-size: 0.9em; font-weight: 700;
        background-color: var(--ui-light-gray); border: 1px solid var(--ui-border);
    }
    .amenity-display-item.available { color: var(--brand-green); border-color: var(--brand-green);}
    .amenity-display-item.unavailable { color: var(--text-light); }

    /* --- Option Pills / Button Selectors (Unchanged) --- */
    .option-pill-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .option-pill-btn {
        padding: 10px 16px;
        border-radius: var(--border-radius-large);
        border: 1px solid var(--ui-border);
        background: var(--ui-light-gray);
        color: var(--text-dark);
        font-size: 0.9em;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    .option-pill-btn.selected {
        background: var(--brand-blue);
        color: white;
        border-color: var(--brand-blue);
    }
    .option-pill-btn.selected.positive {
        background: var(--brand-green); border-color: var(--brand-green);
    }
    .option-pill-btn.selected.negative {
        background: var(--brand-red); border-color: var(--brand-red);
    }

    /* Price Range (inherits from option-pill-btn but with accent color) */
    .price-range-selector { display: flex; gap: 8px; margin-top: 8px; }
    .price-range-btn {
        flex: 1; padding: 8px; font-size: 1.1em; font-weight: 800;
        border: 1px solid var(--ui-border); background: var(--ui-light-gray);
        border-radius: var(--border-radius-medium); cursor: pointer; color: var(--text-light);
        transition: all 0.2s;
    }
    .price-range-btn.selected { 
        background: var(--brand-purple); color: white; border-color: var(--brand-purple); 
    }
/* --- NEW: Hours Display & Editor Styles --- */

/* Read-only display lines */
.hours-display-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 1.1em;
    font-weight: 700;
}
.hours-day {
    color: var(--text-dark);
}
.hours-time {
    color: var(--text-light);
    font-weight: 400;
}
/* Ensure the first one has no top padding */
.hours-display-line:first-child {
    padding-top: 0;
}

/* Edit mode input group */
.hours-tag-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
/* Give day/time inputs proportional space */
.hours-tag-input-group input[data-key="hours-day-input"] {
    flex: 2;
}
.hours-tag-input-group input[data-key="hours-time-input"] {
    flex: 3;
}
.add-tag-btn.positive-btn {
    background-color: var(--brand-green);
}
.add-tag-btn.positive-btn:active {
    background-color: #28a745;
}

/* Container for the removable hours pills */
.hours-pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* A single removable hours pill */
.hours-pill {
    display: inline-flex;
    align-items: center;
    background: var(--brand-green); /* Green for hours */
    color: white;
    border-radius: var(--border-radius-large);
    padding: 6px 8px 6px 12px;
    font-size: 0.9em;
    font-weight: 700;
    animation: popIn 0.2s ease-out;
}
.hours-pill span {
    margin-right: 6px;
}
/* --- NEW: Style for "Neutral" amenity items --- */
/* --- NEW: Style for "Neutral" amenity items --- */

/* For the read-only display pill (e.g., "Reservations Recommended") */
.amenity-display-item.neutral {
    color: var(--text-dark);
    border-color: var(--ui-border);
    background-color: var(--ui-light-gray);
}

/* For the "Unsure" button in the editor */
.option-pill-btn.neutral {
    /* Uses default gray styles, which is perfect */
}

/* For the "Unsure" button when it is selected */
.option-pill-btn.neutral.selected {
    color: white;
    border-color: #8e8e93; /* A medium gray */
    background-color: #8e8e93;
}
/* Uses the same .remove-pill-btn style from amenities */

    #poi-detail-actions {
        flex-shrink: 0;
        padding: 15px 20px 20px;
        border-top: 1px solid var(--ui-border);
        background: var(--ui-background);
    }

    #poi-detail-get-directions-btn {
        width: 100%; padding: 16px 12px; border: none; color: white;
        cursor: pointer; border-radius: var(--border-radius-large);
        font-size: 1.2em; font-weight: 800;
        background-color: var(--brand-blue); 
        border: 2px solid var(--text-dark); 
        transition: transform 0.1s, background-color 0.2s; 
    }
    #poi-detail-get-directions-btn:active { 
        transform: scale(0.98);
        background-color: #2a62aa; 
    }

    /* --- Save Button Style --- */
    #poi-save-btn {
        width: 100%; padding: 14px 12px; border: none; color: white;
        cursor: pointer; border-radius: var(--border-radius-large);
        font-size: 1.1em; font-weight: 800;
        background-color: var(--brand-purple);
        border: 2px solid var(--text-dark);
        transition: transform 0.1s, background-color 0.2s;
        margin-top: 10px;
    }
    #poi-save-btn:active { transform: scale(0.98); background-color: #9a48c7; }
    #poi-save-btn:disabled { 
        background-color: #9E9E9E; 
        cursor: wait; 
        opacity: 0.7;
    }


    #recenter-button { bottom: 110px; }
    #attribution {
        bottom: 80px; z-index: 5;
        right: 50%; transform: translateX(50%);
    }
    /* --- Ticket Reward Animation --- */
#ticket-reward-animation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) perspective(1000px) rotateX(0deg); /* Start flat */
  opacity: 0;
  z-index: 9999;
  pointer-events: none; /* Invisible when not active */
}

#ticket-reward-animation.show {
  pointer-events: auto;
  animation: pop-and-fly 2.5s cubic-bezier(0.2, 0.7, 0.4, 1.2) forwards; /* Main animation */
}

.ticket-box {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%); /* Purple to Blue */
  color: white;
  padding: 25px 40px;
  border-radius: 100px; /* Pill shape */
  display: flex;
  align-items: center;
  font-family: 'Poppins', sans-serif; /* Or your preferred bold font */
  font-weight: 700; /* Bold */
  font-size: 28px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4); /* Deeper shadow */
  position: relative;
  overflow: hidden; /* For internal effects */
}

.ticket-icon {
  font-size: 40px;
  margin-right: 15px;
  animation: jiggle 0.4s ease-in-out 0.2s 3 alternate; /* Jiggle on show */
  position: relative;
  z-index: 2; /* Above sparkles */
}

.ticket-message {
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2; /* Above sparkles */
}

/* --- Sparkle Effect --- */
.sparkle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1; /* Below text */
}

.sparkle {
  position: absolute;
  background-color: #ffeb3b; /* Yellow sparkle */
  border-radius: 50%;
  animation: sparkle-fade 1s ease-out forwards;
}

@keyframes sparkle-fade {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}


/* --- Keyframe Animations --- */

/* Main pop-up and fly-away animation */
@keyframes pop-and-fly {
  0% { /* Start hidden, small, slightly rotated */
    opacity: 0;
    transform: translate(-50%, -50%) perspective(1000px) rotateX(45deg) scale(0.5);
  }
  20% { /* Pop in, larger, less rotated */
    opacity: 1;
    transform: translate(-50%, -50%) perspective(1000px) rotateX(-5deg) scale(1.1);
  }
  35% { /* Settle */
    opacity: 1;
    transform: translate(-50%, -50%) perspective(1000px) rotateX(0deg) scale(1);
  }
  75% { /* Hold, then start fade/fly */
    opacity: 1;
    transform: translate(-50%, -50%) perspective(1000px) rotateX(0deg) scale(1);
  }
  100% { /* Fade out, fly up and rotate */
    opacity: 0;
    transform: translate(-50%, -150%) perspective(1000px) rotateX(60deg) scale(0.7);
  }
}

/* Jiggle for the ticket icon */
@keyframes jiggle {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
  100% { transform: rotate(0deg); }
}
/* --- Custom Keypad Styles --- */
/* --- Restyled Keypad (Light Theme) --- */
/* --- Restyled Poppy Keypad --- */
/* --- Restyled Poppy Keypad (Bright & White Theme) --- */
/* --- Restyled Poppy Keypad (Cartoon Pop Theme) --- */
/* --- Restyled Keypad (Waze-Style Dark Theme) --- */
/* --- Restyled Keypad (Light App Theme) --- */
/* --- Restyled Keypad (Matches Site Theme) --- */
#keypad-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use the same backdrop as your modal */
    background: rgba(0,0,0,0.4); 
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s ease-out;
}
#keypad-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

#custom-keypad {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Use your site's main white background */
    background: var(--ui-background); 
    z-index: 1001;
    /* Use your large radius for the top corners */
    border-top-left-radius: var(--border-radius-large);
    border-top-right-radius: var(--border-radius-large);
    /* Use your soft shadow */
    box-shadow: 0 -8px 24px rgba(0,0,0,0.12); /* Based on --shadow-soft */
    transform: translateY(100%);
    /* Bouncy "poppy" slide-in animation */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding-bottom: env(safe-area-inset-bottom, 20px);
    /* CRITICAL: Use your app's font */
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-dark);
}
#custom-keypad.visible {
    transform: translateY(0);
}

/* Display */
#keypad-display-container {
    padding: 20px 30px;
    text-align: right;
    color: var(--text-dark);
    font-size: 56px;
    font-weight: 300; /* Thin for the large numbers */
    /* Use your theme's separator */
    border-bottom: 1px solid var(--ui-border); 
    background: var(--ui-light-gray); /* Match other headers */
    border-top-left-radius: var(--border-radius-large);
    border-top-right-radius: var(--border-radius-large);
}
#keypad-currency-symbol {
    opacity: 0.5;
    margin-right: 5px;
    color: var(--text-light);
}

/* Key Grid */
#keypad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px; /* Bubbly gaps */
    padding: 8px;
}
/* Action Row */
#keypad-action-row {
    display: flex;
    gap: 8px;
    padding: 0 8px 8px 8px;
}

.keypad-btn {
    background: var(--ui-background); /* White keys */
    color: var(--text-dark);
    font-size: 28px;
    font-weight: 700; /* BOLD, per your theme */
    padding: 22px 0;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    border-radius: var(--border-radius-medium); /* 16px bubbly */
    /* Softer, more modern shadow */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
}

/* --- Clean Pop Animation (No JS needed) --- */
.keypad-btn:active {
    transform: scale(0.95); /* Bubbly "squish" */
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* Reduced shadow */
}

/* Action Buttons */
.keypad-btn.action {
    flex: 1; /* Make buttons share space */
    background: var(--ui-light-gray); /* Use theme's light gray */
    color: var(--text-dark);
    font-weight: 700;
}

.keypad-btn.action.done {
    /* Use your primary brand color */
    background: var(--brand-blue); 
    color: white;
    font-weight: 800; /* Extra bold for primary action */
    box-shadow: 0 4px 12px #3070C566; /* Subtle brand shadow */
}

/* --- Input Field Styling --- */
/* This now matches your .detail-edit-group input */
.input-prefix-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--ui-border);
    border-radius: var(--border-radius-medium); /* Match theme */
    background: var(--ui-light-gray); /* Match theme */
    transition: all 0.2s;
}
/* Add a focus state */
.input-prefix-group:has(input:focus) {
    border-color: var(--brand-blue);
    background-color: var(--ui-background);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}

.input-prefix-group span.input-prefix {
    padding-left: 12px;
    font-size: 1em; /* Match theme */
    font-weight: 700; /* Match theme */
    color: var(--text-light); /* Match theme */
}
.input-prefix-group input[readonly] {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 12px 14px 12px 5px; /* Match .detail-edit-group input */
    cursor: pointer;
    width: 100%;
    font-size: 1em; /* Match theme */
    font-weight: 700; /* Match theme */
    color: var(--text-dark);
    font-family: 'Nunito', sans-serif; /* Match theme */
}
.input-prefix-group input[readonly][placeholder="N/A"] {
    color: var(--text-light);
    font-style: italic;
    font-weight: 400;
}
/* In style.css, at the end of the file */

/* --- Report Feedback Panel --- */
/* In style.css, at the end of the file */

/* --- Report Feedback Panel --- */
/* In style.css, at the end of the file */

/* --- Report Feedback Panel --- */
/* In style.css, at the end of the file */

/* --- Report Feedback Panel --- */
/* In style.css, add this new CSS */

/* This is the new panel, which sits at the top */
#report-feedback-panel {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 2001;
    max-width: 400px; /* Stops it from being too wide on desktop */
    margin: 0 auto; /* Centers the panel */
}

/* This is the white content box */
#feedback-panel-content {
    background: var(--ui-background);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-soft);
    padding: 20px;
}

/* Header section (icon + title) */
#feedback-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

#feedback-report-icon {
    width: 48px;
    height: 48px;
    padding: 8px;
    box-sizing: border-box;
    background-color: var(--ui-light-gray);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Re-styles the title to be big and bold */
#feedback-report-type {
    font-size: 1.6em;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
    text-align: left;
}

/* Removes the old question text */
#feedback-question {
    display: none;
}

/* New: container for the side-by-side buttons */
.feedback-btn-row {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

/* Styles all buttons */
.feedback-btn {
    padding: 16px 12px;
    border: none;
    border-radius: var(--border-radius-large);
    font-size: 1.2em;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s;
    color: white;
}
.feedback-btn:active {
    transform: scale(0.98);
}

/* Makes the Yes/No buttons fill the row */
.feedback-btn.positive,
.feedback-btn.negative {
    flex: 1; /* This makes them side-by-side */
}
/* In style.css, add these new rules */

.feedback-btn.positive {
    background-color: var(--brand-green);
    border: 2px solid var(--text-dark);
}

.feedback-btn.negative {
    background-color: var(--brand-red);
    border: 2px solid var(--text-dark);
}
/* The "Unsure" button */
/* In style.css, FIND and REPLACE these rules */

/* 1. REPLACE your existing .feedback-btn.neutral rule */
.feedback-btn.neutral {
    width: 100%;
    margin-top: 12px;
    background-color: var(--ui-light-gray);
    color: var(--text-dark);
    border: 2px solid var(--ui-border);
    /* This is the key: */
    position: relative;
    overflow: hidden;
    /* z-index: 1; <-- REMOVE this line if it's here */
}

/* 2. ADD THIS NEW RULE for the button's text */
.feedback-btn.neutral span {
    position: relative;
    z-index: 2; /* Puts the text on top */
}

/* 3. REPLACE your existing .progress-bar rule */
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%; /* Starts at 0% */
    background-color: var(--brand-blue);
    opacity: 0.4; /* Made it a bit more visible */
    z-index: 1;   /* Puts the bar behind the text */
    transition: none; /* Transition is set by JS */
}
/* In style.css, at the end */

/* --- Create Report Button --- */
/* In style.css, REPLACE lines 957-969 */

/* --- Create Report Button --- */
#create-report-btn {
    bottom: 110px; /* Positioned above the recenter button */
    right: 10px;
    background-color: var(--ui-background); /* White BG */
    color: var(--text-dark); /* Black icon/text color */
    width: 56px;
    height: 56px;
    border: 2px solid var(--text-dark); /* Black outline */
    transition: transform 0.2s, background-color 0.2s;
    border-radius: 50%; /* Make it a circle */
    /* Keep shadow from .map-control-button */
}
#create-report-btn:active {
    transform: scale(0.95);
    background-color: var(--ui-light-gray); /* Light gray on press */
}
/* Style for the new icon inside the button */
/* In style.css */

/* Style for the new icon inside the button */
.create-report-icon {
    width: 36px;  /* Was 28px */
    height: 36px; /* Was 28px */
    object-fit: contain;
}
/* End of replacement */
/* Adjust recenter button to make space */
#recenter-button {
    bottom: 180px; /* Moved up */
}
/* Adjust attribution on mobile */
@media screen and (max-width: 768px) {
    #attribution {
        bottom: 150px; /* Moved up */
    }
}


/* --- Report Menu Panel --- */
/* In style.css, ADD this new CSS at the end */

/* --- NEW Report Menu Panel (Bottom Sheet) --- */
/* In style.css, REPLACE lines 1072-1135 */

/* --- NEW Report Menu Panel (Bottom Sheet) --- */
#report-menu-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: var(--ui-background);
    border-top-left-radius: var(--border-radius-large);
    border-top-right-radius: var(--border-radius-large);
    box-shadow: var(--shadow-soft);
    width: 100%;
    height: auto;
    max-height: 60vh; /* Max 60% of viewport height */
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
#report-menu-panel.visible {
    transform: translateY(0);
}

/* Header (Title + Close/Back Buttons) */
#report-menu-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid var(--ui-border);
    min-height: 48px;
    position: relative;
}
#report-menu-title {
    font-size: 1.4em;
    font-weight: 800;
    color: var(--text-dark);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.report-menu-nav-btn {
    background: var(--ui-light-gray);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--text-dark);
    flex-shrink: 0;
}
#report-menu-back-btn {
    background: none;
}

/* --- THIS IS THE FIX --- */

/* Content Area is now the "window" that slides */
#report-menu-content {
    flex-grow: 1;
    overflow-x: hidden; /* Hide horizontal slide */
    overflow-y: auto;   /* Allow vertical scroll */
    padding: 20px;
    padding-bottom: env(safe-area-inset-bottom, 20px);
    position: relative;
    /* This MUST be set for the animation to work */
    display: flex; 
}

/* Level 1 & 2 Containers */
#report-menu-level-1,
#report-menu-level-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 20px 15px;
    
    /* Animation */
    width: 100%;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    
    /* This is new: */
    flex-shrink: 0; /* Prevents the divs from shrinking */
}

/* Level 2 starts off-screen */
#report-menu-level-2 {
    transform: translateX(100%);
    opacity: 0;
    position: absolute;
    top: 20px;
    left: 20px; /* Match padding */
    right: 20px; /* Match padding */
    width: calc(100% - 40px); /* Match padding */
}

/* State when Level 2 is active */
#report-menu-level-1.hidden {
    transform: translateX(-100%);
    opacity: 0;
}
#report-menu-level-2:not(.hidden) {
    transform: translateX(0);
    opacity: 1;
    position: relative; /* Change to relative */
    top: 0;
    left: 0;
    width: 100%;
}

/* --- END OF FIX --- */


/* Report Icon Button (for both levels) */
.report-category-btn,
.report-subcategory-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    transition: transform 0.1s;
}
.report-category-btn:active,
.report-subcategory-btn:active {
    transform: scale(0.92);
}

/* The circular icon wrapper */
.report-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--ui-light-gray);
    border: 2px solid var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.report-icon-wrapper img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* The text label below the icon */
.report-category-btn span,
.report-subcategory-btn span {
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
}

/* This class will be added by JS to start the timer */
.progress-bar.active {
    width: 100%;
    transition: width 10s linear;
}
/* --- Optional: Add Google Fonts --- */
/* If you want to use 'Poppins' font, add this to your HTML <head> */
/* <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@700&display=swap" rel="stylesheet"> */
    
}