:root {
    --bg-color: #FFF8E7; 
    --card-bg: #FFFFFF;
    --primary: #FFB347; 
    --secondary: #8D6E63;
    --text: #5D4037; 
    --border: #F0E6D2;
    --delete: #E57373;
    --accept: #81C784;
}

body {
    font-family: 'Quicksand', sans-serif;
    margin: 0; padding: 0; display: flex; height: 100vh;
    color: var(--text); overflow: hidden;
}

.sidebar {
    width: 30%; min-width: 360px; background-color: var(--bg-color);
    padding: 25px; overflow-y: auto; box-shadow: 4px 0 15px rgba(0,0,0,0.05);
    z-index: 10; box-sizing: border-box; display: flex; flex-direction: column;
}

.map-area { flex-grow: 1; background-color: #e5e3df; position: relative; }
#map { width: 100%; height: 100%; }

h1 { text-align: center; font-size: 1.8em; margin: 0 0 5px 0; }
p.subtitle { text-align: center; margin-top: 0; color: var(--secondary); margin-bottom: 25px; font-size: 0.9em; }

.view-pane { display: none; flex-direction: column; }
.view-pane.active { display: flex; }

.input-group { margin-bottom: 20px; }
label { font-weight: 600; display: block; margin-bottom: 8px; font-size: 0.9em; }
input[type="text"], input[type="date"], input[type="number"], textarea {
    width: 100%; padding: 10px; border: 2px solid var(--border);
    border-radius: 10px; font-family: inherit; box-sizing: border-box;
    resize: none;
}

.google-info-card {
    background: #fdfbf7; border: 2px dashed var(--border); 
    border-radius: 12px; padding: 12px; margin-bottom: 20px;
}
.google-rating {
    font-weight: bold; color: #E65100; font-size: 1.1em; margin-bottom: 10px;
}
.photo-gallery {
    display: flex; gap: 8px; overflow-x: auto; 
    padding-top: 8px; /* NEW: Gives the red X room to breathe! */
    padding-bottom: 5px;
}
.photo-gallery::-webkit-scrollbar { height: 6px; }
.photo-gallery::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.photo-gallery img {
    height: 90px; width: 90px; object-fit: cover; border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); flex-shrink: 0;
}

.selected-cafe-title { font-size: 1.4em; font-weight: bold; color: var(--primary); margin-bottom: 15px; border-bottom: 2px dashed var(--border); padding-bottom: 10px;}
.category-card { border: 2px solid var(--border); border-radius: 15px; padding: 15px; margin-bottom: 15px; background-color: var(--card-bg); }
.category-header { font-size: 1.1em; font-weight: 700; margin-bottom: 12px; }
.rating-row { display: flex; gap: 10px; margin-bottom: 12px; }
.rating-input { flex: 1; display: flex; flex-direction: column; }

/* --- NEW COFFEE ANIMATION STYLES --- */
.coffee-toggle { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-weight: bold; 
}
.coffee-toggle input[type="checkbox"] {
    width: 18px; 
    height: 18px; 
    cursor: pointer; 
    accent-color: var(--primary); /* Makes the checkbox orange! */
}

/* The Grid trick for smooth sliding */
.coffee-collapsible {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-out;
}
.coffee-collapsible.open {
    grid-template-rows: 1fr;
}
.coffee-collapsible-inner {
    overflow: hidden;
}

.btn-group { display: flex; gap: 10px; margin-top: 10px; }
button { background-color: var(--primary); color: white; border: none; padding: 15px; border-radius: 12px; font-size: 1.1em; font-weight: 700; cursor: pointer; width: 100%; font-family: inherit; transition: transform 0.1s; }
button:active { transform: scale(0.98); }
button.cancel-btn { background-color: #E0E0E0; color: var(--text); }

.history { margin-top: 10px; width: 100%; }
.history-item { background: var(--card-bg); border: 2px solid var(--border); padding: 15px; border-radius: 15px; margin-bottom: 10px; font-size: 0.9em; cursor: pointer; transition: background 0.2s;}
.history-item:hover { background: #fafafa; }

.detail-card { background: var(--card-bg); border: 2px solid var(--border); padding: 20px; border-radius: 15px; text-align: center; margin-bottom: 15px;}
.detail-score { font-size: 2.5em; font-weight: bold; color: var(--primary); margin: 5px 0; }
.vs-badge { display: inline-block; background: #eee; padding: 5px 10px; border-radius: 20px; font-size: 0.8em; margin-bottom: 10px;}

/* COMMENT BOX STYLES */
.detail-comment-box {
    background-color: var(--bg-color);
    border-left: 4px solid var(--primary);
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    text-align: left;
    font-size: 0.95em;
    color: var(--text);
    line-height: 1.4;
}

/* EDIT & DELETE BUTTONS */
.action-btn-group { display: flex; gap: 10px; margin-top: 15px; }
.action-btn-group button { padding: 12px; font-size: 1em; }
.edit-btn { background-color: var(--accept); } /* Soft green */
.delete-btn { background-color: var(--delete); } /* Soft red */

/* --- GOOGLE MAPS AUTOCOMPLETE DROPDOWN STYLING --- */
.pac-container {
    border-radius: 12px;
    border: 2px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    font-family: 'Quicksand', sans-serif;
    margin-top: 5px;
    border-top: 2px solid var(--border) !important;
    box-sizing: border-box !important; 
    
    width: var(--search-width) !important;
    left: var(--search-left) !important;
}

.pac-item {
    padding: 10px;
    font-size: 1em;
    cursor: pointer;
    border-top: 1px solid #f9f9f9;
}

.pac-item:hover {
    background-color: var(--bg-color); /* Soft butter yellow hover */
}

.pac-item-query {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--text);
}

/* Hides the clunky Google logo at the bottom of the list for a cleaner look */
.pac-logo::after {
    display: none !important;
}

/* --- CUSTOM PHOTO UPLOAD STYLES --- */
input[type="file"] {
    width: 100%; padding: 10px; border: 2px dashed var(--border);
    border-radius: 10px; font-family: inherit; box-sizing: border-box;
    background-color: #fafafa; cursor: pointer; color: var(--text);
}
input[type="file"]::file-selector-button {
    background-color: var(--primary);
    color: white; border: none; padding: 8px 12px;
    border-radius: 8px; cursor: pointer;
    font-family: inherit; font-weight: bold; margin-right: 10px;
    transition: transform 0.1s;
}
input[type="file"]::file-selector-button:active {
    transform: scale(0.95);
}

/* --- IMAGE LIGHTBOX & GALLERY HOVER --- */
.photo-gallery img {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.photo-gallery img:hover {
    transform: scale(1.05); /* Slight zoom when hovering to show it's clickable */
}

.image-modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 9999; /* Sit on top of everything! */
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.85); /* Dark transparent background */
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(4px); /* Fancy blur effect */
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--delete);
}

/* --- CUSTOM PHOTO PREVIEW & DELETE BUTTON --- */
.preview-img-container {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}
.preview-img-container img {
    height: 90px; width: 90px; object-fit: cover; border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); display: block;
}
.delete-photo-btn {
    position: absolute;
    top: -5px; right: -5px;
    background-color: var(--delete); color: white;
    border-radius: 50%; width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: bold; cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); border: none; padding: 0;
    transition: transform 0.1s;
}
.delete-photo-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    body { flex-direction: column; overflow: auto; }
    .sidebar { width: 100%; order: 2; box-shadow: none;}
    .map-area { width: 100%; height: 50vh; order: 1; }
}