/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary-color: #ff9a00;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-color: #6b7280;
    --bg-light: #f8fafc;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    padding-top: env(safe-area-inset-top);
    /* 아이폰 노치 여백 대응 */
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-light);
    height: 100vh;
    /* Fixed height for full viewport */
    overflow: hidden;
    /* Prevent body scroll */
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Header */
.header {
    /* Removed fixed positioning */
    position: relative;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    /* Prevent header from shrinking */
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
}

/* Header Controls */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-menu-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.header-menu-btn:hover {
    transform: scale(1.1);
}

.header-right .info-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 20px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.lang-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 6px 30px 6px 12px;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
}

.lang-select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.lang-select option {
    background: white;
    color: var(--text-dark);
}

/* Search & Filter Bar */
.search-filter-bar {
    /* Removed fixed positioning */
    position: relative;
    z-index: 999;
    background: white;
    padding: 12px 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.search-container {
    flex: 1;
    min-width: 200px;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-light);
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* 브라우저 기본 검색 취소 버튼 숨기기 */
#search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
}

.filter-row {
    display: flex;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.filter-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: var(--text-gray);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-color: transparent;
    color: white;
}

/* View Toggle */
.view-toggle {
    position: absolute;
    /* Absolute within main-content */
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.view-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: white;
    box-shadow: var(--shadow-lg);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.view-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

/* List Container */
.list-container {
    position: absolute;
    /* Change to absolute to overlay map within main-content */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-light);
    overflow-y: auto;
    z-index: 1;
    padding: 16px;
}

/* Leaflet Zoom Controls - Move below filter bar */
.leaflet-control-zoom {
    margin-top: 10px !important;
    /* Reset margin since it's inside relative container */
}

.restaurant-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 80px;
}

/* Restaurant Card */
.restaurant-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.restaurant-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-content {
    padding: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Korean subtitle for foreign language display */
.korean-subtitle {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-gray);
    opacity: 0.8;
}

.korean-subtitle-inline {
    display: block;
    font-size: 0.7rem;
    color: var(--text-gray);
    opacity: 0.7;
    margin-top: 2px;
}

/* Card meta row - below title */
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.card-category-badge {
    padding: 4px 8px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-gray);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.card-info-row span:first-child {
    flex-shrink: 0;
}

.card-category {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-light);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-top: 10px;
}

/* Distance Badge */
.distance-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
    white-space: nowrap;
}

/* Modal Header Top */
.modal-header-top {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    /* Take remaining height */
    position: relative;
    overflow: hidden;
    /* Contain map */
    width: 100%;
}

/* Map Container */
#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Custom Markers */
.marker-open {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.marker-break {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.marker-closed {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.marker-holiday {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(248, 113, 113, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.marker-soon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: transform 0.2s ease;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.marker-open:hover,
.marker-break:hover,
.marker-closed:hover,
.marker-holiday:hover {
    transform: scale(1.15);
}

/* Modal Overlay - Base Styles (applies to all screen sizes) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Install Modal Specific Styles */
#install-modal .modal-content {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    max-width: 400px;
    width: 100%;
    padding: 32px 24px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
}

/* Modal Container - Bottom Slide-up Panel Style */
.modal-container {
    background: white;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: #e2e8f0;
}

/* Modal Content - Inner padding and layout */
.modal-content {
    padding: 24px;
    padding-right: 48px;
    /* space for close button */
}

/* Modal Header with name and status */
.modal-header-new {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.modal-name-section {
    flex: 1;
}

.modal-name-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.modal-name-korean {
    font-size: 0.85rem;
    color: #6b7280;
    display: block;
    margin-bottom: 8px;
}

.modal-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-quick-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.quick-action-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.quick-action-btn:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

.quick-action-btn.active {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* Info Grid - Card-based layout */
.modal-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    background: transparent;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item.full-width {
    grid-column: span 2;
}

.info-icon {
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 10px;
    flex-shrink: 0;
}

.info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.info-text label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.info-text span,
.info-text a {
    font-size: 0.95rem;
    color: #374151;
    font-weight: 500;
    line-height: 1.4;
}

.info-text a {
    color: #3b82f6;
    text-decoration: none;
}

.info-text a:hover {
    text-decoration: underline;
}

.modal-address-korean {
    font-size: 0.85rem;
    color: #9ca3af;
    font-weight: 400;
    margin-top: 2px;
}

/* Navigation Buttons - Colorful style */
.nav-buttons-new {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

/* Instagram Link Container - Separate Row */
.instagram-link-container {
    margin-bottom: 20px;
}

.nav-btn-new {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 10px;
    border: 1px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-btn-new .nav-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

.nav-btn-new.kakao {
    background: linear-gradient(135deg, #fee500 0%, #e6c800 100%);
    color: #3c1e1e;
}

.nav-btn-new.naver {
    background: linear-gradient(135deg, #2db400 0%, #1d8a00 100%);
}

.nav-btn-new.tmap {
    background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
}

.nav-btn-new.instagram {
    background: linear-gradient(135deg, #E1306C 0%, #C13584 100%);
    flex: none;
    width: 100%;
}

.nav-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* YouTube Container */
.youtube-container {
    margin-bottom: 20px;
}

.youtube-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.youtube-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 16px;
    overflow: hidden;
}

.youtube-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Modal Description */
.modal-description {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.modal-description h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}

.modal-description p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #4b5563;
}

/* ==========================================
   Random Recommendation Modal
   ========================================== */

.random-modal-container {
    background: white;
    border-radius: 24px;
    max-width: 420px;
    width: 90%;
    padding: 32px 24px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.random-header {
    margin-bottom: 24px;
}

.random-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.random-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Roulette Area */
.roulette-area {
    position: relative;
    margin-bottom: 24px;
}

.roulette-window {
    height: 120px;
    overflow: hidden;
    border-radius: 16px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    position: relative;
}

.roulette-track {
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease-out;
}

.roulette-card {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 16px;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.roulette-card h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.roulette-card p {
    font-size: 0.85rem;
    color: #6b7280;
}

.roulette-pointer {
    position: absolute;
    top: 50%;
    right: -10px;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 1.5rem;
    color: #f97316;
    animation: pulse-pointer 1s ease-in-out infinite;
}

@keyframes pulse-pointer {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Result Area */
.result-area {
    margin-bottom: 24px;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.result-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-card:hover {
    background: #fff7ed;
    border-color: #fdba74;
    transform: translateY(-2px);
}

.result-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.result-card p {
    font-size: 0.85rem;
    color: #6b7280;
}

.result-card .distance {
    font-size: 0.8rem;
    color: #f97316;
    font-weight: 500;
    margin-top: 4px;
}

/* No Result Area */
.no-result-area {
    padding: 40px 20px;
}

.no-result-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.no-result-area p {
    color: #6b7280;
    margin-bottom: 8px;
}

.no-result-hint {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Random Actions */
.random-actions {
    margin-top: 16px;
}

.random-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.random-btn.primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

.random-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

.random-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    margin-top: 12px;
}

.random-btn.secondary:hover {
    background: #e2e8f0;
}

/* Custom Leaflet Popup - White Theme */
.leaflet-popup-content-wrapper {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup {
    z-index: 2000 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    min-width: 280px !important;
    max-width: 320px !important;
    width: 280px !important;
}

/* Heart in title */
.title-heart {
    margin-right: 4px;
}

.popup-content {
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.popup-content:hover {
    background: var(--bg-light);
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.popup-content h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    word-break: keep-all;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-open {
    background: #dcfce7;
    color: #166534;
}

.status-break {
    background: #fef3c7;
    color: #92400e;
}

.status-closed {
    background: #f3f4f6;
    color: #374151;
}

.status-holiday {
    background: #fecaca;
    color: #b91c1c;
}

.status-soon {
    background: #dcfce7;
    color: #15803d;
    font-weight: 700;
    border: 1px solid #86efac;
}

.popup-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.popup-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-gray);
    line-height: 1.4;
}

.popup-info-row span:first-child {
    flex-shrink: 0;
}

.popup-info-row span:last-child {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popup-cta {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Popup Korean subtitle for foreign language */
.popup-korean-sub {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-gray);
    opacity: 0.7;
    margin-top: 2px;
}

.popup-korean-sub-inline {
    display: block;
    font-size: 0.65rem;
    color: var(--text-gray);
    opacity: 0.6;
    margin-top: 1px;
}

/* Grouped Popup Styles */
.group-popup {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    max-height: 320px;

    /* Google Login Button */
    .google-login-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        width: 100%;
        padding: 12px 16px;
        background: white;
        border: 1px solid #dadce0;
        border-radius: 4px;
        color: #3c4043;
        font-size: 14px;
        font-weight: 500;
        font-family: 'Google Sans', 'Roboto', sans-serif;
        cursor: pointer;
        transition: background-color 0.2s, box-shadow 0.2s;
    }

    .google-login-btn:hover {
        background-color: #f7fafe;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        border-color: #d2e3fc;
    }

    .google-login-btn:active {
        background-color: #f1f3f4;
        box-shadow: none;
    }

    .google-login-btn img {
        width: 18px;
        height: 18px;
    }

    .popup-group-header {
        background: white;
        padding: 14px 16px;
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-dark);
        border-bottom: 1px solid #f3f4f6;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .popup-group-list {
        overflow-y: auto;
        padding: 8px;
        flex: 1;
        background: #f8fafc;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* New Card Style for Group Items */
    .popup-group-card {
        background: white;
        border-radius: 12px;
        padding: 12px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid #e5e7eb;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .popup-group-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        border-color: var(--primary-color);
    }

    .group-card-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
        /* Text truncation fix */
    }

    .group-card-header {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .group-card-name {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .group-card-meta {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .group-card-category {
        font-size: 0.75rem;
        color: var(--text-gray);
        background: #f3f4f6;
        padding: 2px 6px;
        border-radius: 4px;
    }

    .group-card-arrow {
        color: #d1d5db;
        font-size: 1.2rem;
        margin-left: 8px;
        font-weight: 300;
    }

    /* Modal */
    .modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 2000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        animation: fadeIn 0.2s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .modal-container {
        background: white;
        border-radius: 24px;
        max-width: 480px;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
        box-shadow: var(--shadow-xl);
        animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
        from {
            transform: translateY(20px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal-close {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        border: none;
        background: var(--bg-light);
        border-radius: 50%;
        font-size: 1.1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        z-index: 10;
    }

    .modal-close:hover {
        background: #e5e7eb;
    }

    .modal-content {
        padding: 24px;
    }

    .modal-header {
        margin-bottom: 24px;
    }

    .modal-header .status-badge {
        margin-bottom: 8px;
        display: inline-block;
    }

    .modal-header h2 {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text-dark);
    }

    .modal-info-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }

    .info-item {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
        background: var(--bg-light);
        border-radius: 12px;
    }

    .info-item.full-width {
        grid-column: 1 / -1;
    }

    .info-icon {
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .info-text {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .info-text label {
        font-size: 0.75rem;
        color: var(--text-gray);
        font-weight: 500;
    }

    .info-text span,
    .info-text a {
        font-size: 0.9rem;
        color: var(--text-dark);
        font-weight: 500;
        word-break: break-word;
    }

    .info-text a {
        color: var(--primary-color);
        text-decoration: none;
    }

    /* Modal Name Container for two-line layout */
    .modal-name-container {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    /* Korean subtitle for modal name (smaller, gray) */
    .modal-name-korean {
        display: block;
        font-size: 0.85rem;
        font-weight: 400;
        color: var(--text-gray);
        opacity: 0.8;
    }

    /* Korean subtitle for modal address (smaller, gray) */
    .modal-address-korean {
        display: block;
        font-size: 0.8rem;
        font-weight: 400;
        color: var(--text-gray);
        opacity: 0.8;
        margin-top: 4px;
    }

    /* Navigation Buttons */
    .nav-buttons,
    .nav-buttons-new {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 24px;
    }

    .nav-btn,
    .nav-btn-new {
        padding: 14px 12px;
        border: none;
        border-radius: 12px;
        font-size: 0.85rem;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        transition: all 0.2s ease;
        font-family: inherit;
    }

    .nav-btn span {
        font-size: 1.3rem;
    }

    /* Specific Buttons */
    .nav-btn.kakao,
    .nav-btn-new.kakao {
        background: #fee500;
        color: #3c1e1e;
    }

    .nav-btn.kakao:hover,
    .nav-btn-new.kakao:hover {
        background: #fdd800;
    }

    .nav-btn.naver,
    .nav-btn-new.naver {
        background: #03c75a;
        color: white;
    }

    .nav-btn.naver:hover,
    .nav-btn-new.naver:hover {
        background: #02b350;
    }

    .nav-btn.tmap,
    .nav-btn-new.tmap {
        background: #1a73e8;
        color: white;
    }

    .nav-btn.tmap:hover,
    .nav-btn-new.tmap:hover {
        background: #1565c0;
    }

    .nav-btn.instagram,
    .nav-btn-new.instagram {
        background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
        color: white;
    }

    .nav-btn.instagram:hover,
    .nav-btn-new.instagram:hover {
        filter: brightness(1.1);
    }

    /* YouTube Embed */
    .youtube-container {
        margin-bottom: 24px;
    }

    .youtube-container h3 {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 12px;
    }

    .youtube-wrapper {
        position: relative;
        width: 100%;
        padding-bottom: 56.25%;
        /* 16:9 Aspect Ratio */
        height: 0;
        overflow: hidden;
        border-radius: 12px;
        background: #000;
        box-shadow: var(--shadow-md);
    }

    .youtube-wrapper iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 12px;
    }

    /* Description */
    .modal-description {
        margin-bottom: 20px;
    }

    .modal-description h3 {
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 10px;
    }

    .modal-description p {
        font-size: 0.9rem;
        color: var(--text-gray);
        line-height: 1.7;
        white-space: pre-wrap;
    }

    /* YouTube Button */
    .youtube-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px;
        background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
        color: white;
        border-radius: 12px;
        font-size: 0.95rem;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .youtube-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    }

    /* Leaflet Controls */
    .leaflet-control-zoom {
        border: none !important;
        box-shadow: var(--shadow-lg) !important;
        border-radius: 12px !important;
        overflow: hidden;
    }

    .leaflet-control-zoom a {
        background: white !important;
        color: var(--text-dark) !important;
        border: none !important;
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
        font-size: 18px !important;
    }

    .leaflet-control-zoom a:hover {
        background: var(--bg-light) !important;
    }

    .leaflet-control-attribution {
        background: rgba(255, 255, 255, 0.9) !important;
        color: var(--text-gray) !important;
        padding: 4px 8px !important;
        border-radius: 8px 0 0 0 !important;
        font-size: 0.7rem !important;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .header {
            padding: 12px 16px;
        }

        .header-left h1 {
            font-size: 1.2rem;
        }

        .search-filter-bar {
            padding: 10px 16px;
            flex-direction: column;
            gap: 10px;
        }

        .search-container {
            width: 100%;
        }

        .filter-container {
            width: 100%;
            justify-content: flex-start;
            overflow-x: auto;
            padding-bottom: 4px;
        }

        .filter-btn {
            padding: 8px 14px;
            font-size: 0.8rem;
            flex-shrink: 0;
        }



        .modal-container {
            max-height: 85vh;
            border-radius: 20px 20px 0 0;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            max-width: 100%;
        }

        .modal-info-grid {
            grid-template-columns: 1fr;
        }

        .nav-buttons {
            grid-template-columns: repeat(3, 1fr);
        }

        .nav-btn {
            padding: 12px 8px;
            font-size: 0.75rem;
        }
    }

    /* ===== Action Buttons (Favorite & Share) ===== */
    .action-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 16px;
    }

    .action-btn {
        padding: 14px 16px;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        background: white;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.2s ease;
        font-family: inherit;
    }

    .action-btn:hover {
        border-color: var(--primary-color);
        transform: translateY(-2px);
    }

    .action-btn.favorite {
        background: white;
        color: var(--text-dark);
    }

    .action-btn.favorite.active {
        background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
        border-color: transparent;
        color: white;
    }

    .action-btn.favorite.active .heart-icon {
        animation: heartBeat 0.3s ease;
    }

    @keyframes heartBeat {

        0%,
        100% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.3);
        }
    }

    .action-btn.share {
        background: white;
        color: var(--text-dark);
    }

    .action-btn.share:hover {
        background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
        border-color: transparent;
        color: white;
    }

    /* Random Button Animation */
    .view-btn#btn-random:hover {
        animation: shake 0.5s ease;
    }

    @keyframes shake {

        0%,
        100% {
            transform: rotate(0deg);
        }

        25% {
            transform: rotate(-10deg);
        }

        75% {
            transform: rotate(10deg);
        }
    }

    /* Toast Notification */
    .toast {
        position: fixed;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%) translateY(100px);
        background: rgba(0, 0, 0, 0.85);
        color: white;
        padding: 14px 24px;
        border-radius: 12px;
        font-size: 0.9rem;
        font-weight: 500;
        z-index: 3000;
        opacity: 0;
        transition: all 0.3s ease;
        box-shadow: var(--shadow-xl);
        text-align: center;
        max-width: 90%;
    }

    .toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    /* Favorite heart on cards */
    .card-favorite {
        position: absolute;
        top: 12px;
        right: 12px;
        font-size: 1.2rem;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    }

    .restaurant-card {
        position: relative;
    }

    /* Favorite heart on map popup */
    .popup-favorite {
        font-size: 0.9rem;
        margin-left: 4px;
    }

    /* ===== New Modal Header Design ===== */
    .modal-header-new {
        margin-bottom: 20px;
    }

    .modal-header-new h2 {
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--text-dark);
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .modal-status-actions {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .modal-status-actions .modal-badges {
        flex: 1;
        /* Take available space, push buttons to right */
    }

    .modal-title-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }

    .modal-title-row h2 {
        font-size: 1.4rem;
        font-weight: 700;
        color: var(--text-dark);
        flex: 1;
        line-height: 1.3;
    }

    .modal-quick-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }

    .quick-action-btn {
        width: 44px;
        height: 44px;
        border: 2px solid #e5e7eb;
        border-radius: 50%;
        background: white;
        font-size: 1.2rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .quick-action-btn:hover {
        transform: scale(1.1);
        border-color: var(--primary-color);
    }

    .quick-action-btn.active {
        background: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
        border-color: transparent;
    }

    .quick-action-btn.active .heart-icon {
        animation: heartBeat 0.3s ease;
    }

    .modal-badges {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    /* ===== New Navigation Buttons Design ===== */
    .nav-buttons-new {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .nav-btn-new {
        padding: 12px 8px;
        border: none;
        border-radius: 12px;
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        transition: all 0.2s ease;
        font-family: inherit;
    }

    .nav-btn-new:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .nav-btn-new img {
        height: 20px;
        width: auto;
    }

    .nav-btn-new .nav-icon {
        width: 24px;
        height: 24px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
        font-weight: 800;
        color: white;
    }

    .nav-btn-new.kakao {
        background: #fee500;
        color: #3c1e1e;
    }

    .nav-btn-new.kakao .nav-icon {
        background: white;
        color: #3c1e1e;
    }

    .nav-btn-new.kakao:hover {
        background: #fdd800;
    }

    .nav-btn-new.naver {
        background: #03c75a;
        color: white;
    }

    .nav-btn-new.naver .nav-icon {
        background: white;
        color: #03c75a;
    }

    .nav-btn-new.naver:hover {
        background: #02b350;
    }

    .nav-btn-new.tmap {
        background: #1a73e8;
        color: white;
    }

    .nav-btn-new.tmap .nav-icon {
        background: white;
        color: #1a73e8;
    }

    .nav-btn-new.tmap:hover {
        background: #1565c0;
    }

    /* ===== Random Recommendation Modal ===== */
    .random-modal-container {
        background: white;
        border-radius: 24px;
        max-width: 420px;
        width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        position: relative;
        box-shadow: var(--shadow-xl);
        animation: slideUp 0.3s ease;
        padding: 24px;
    }

    .random-header {
        text-align: center;
        margin-bottom: 24px;
    }

    .random-header h2 {
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 8px;
    }

    .random-subtitle {
        font-size: 0.9rem;
        color: var(--text-gray);
    }

    /* Roulette Animation */
    .roulette-area {
        position: relative;
        margin-bottom: 20px;
    }

    .roulette-window {
        height: 120px;
        overflow: hidden;
        border-radius: 16px;
        background: linear-gradient(135deg, var(--bg-light) 0%, #e2e8f0 100%);
        border: 2px solid #e5e7eb;
        position: relative;
    }

    .roulette-window::before,
    .roulette-window::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        height: 30px;
        z-index: 10;
        pointer-events: none;
    }

    .roulette-window::before {
        top: 0;
        background: linear-gradient(to bottom, white, transparent);
    }

    .roulette-window::after {
        bottom: 0;
        background: linear-gradient(to top, white, transparent);
    }

    .roulette-track {
        display: flex;
        flex-direction: column;
        transition: transform 0.1s ease-out;
    }

    .roulette-track.spinning {
        transition: none;
    }

    .roulette-track.stopping {
        transition: transform 1s cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    .roulette-card {
        height: 100px;
        margin: 10px 16px;
        padding: 16px;
        background: white;
        border-radius: 12px;
        box-shadow: var(--shadow-md);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }

    /* Mystery card style for roulette */
    .roulette-card.mystery {
        background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
        border: 2px dashed var(--primary-color);
    }

    .roulette-card .mystery-emoji {
        font-size: 2.5rem;
        margin-bottom: 4px;
        animation: wiggle 0.5s ease infinite;
    }

    @keyframes wiggle {

        0%,
        100% {
            transform: rotate(-3deg);
        }

        50% {
            transform: rotate(3deg);
        }
    }

    .roulette-card .mystery-text {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--primary-color);
        opacity: 0.8;
    }

    .roulette-card h4 {
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-dark);
        margin-bottom: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .roulette-card .roulette-info {
        font-size: 0.8rem;
        color: var(--text-gray);
        display: flex;
        gap: 12px;
    }

    .roulette-pointer {
        position: absolute;
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.5rem;
        color: var(--primary-color);
        filter: drop-shadow(0 2px 4px rgba(255, 107, 53, 0.4));
        z-index: 20;
    }

    /* Result Area */
    .result-area {
        margin-bottom: 20px;
    }

    .result-title {
        text-align: center;
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 16px;
        animation: bounceIn 0.5s ease;
    }

    @keyframes bounceIn {
        0% {
            transform: scale(0.5);
            opacity: 0;
        }

        50% {
            transform: scale(1.1);
        }

        100% {
            transform: scale(1);
            opacity: 1;
        }
    }

    .result-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .result-card {
        background: white;
        border-radius: 16px;
        padding: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
        border: 2px solid #e5e7eb;
        cursor: pointer;
        transition: all 0.2s ease;
        animation: fadeInUp 0.4s ease backwards;
    }

    .result-card:nth-child(1) {
        animation-delay: 0.1s;
        border-color: #fbbf24;
        background: linear-gradient(135deg, #fffbeb 0%, white 50%);
    }

    .result-card:nth-child(2) {
        animation-delay: 0.2s;
        border-color: #94a3b8;
        background: linear-gradient(135deg, #f8fafc 0%, white 50%);
    }

    .result-card:nth-child(3) {
        animation-delay: 0.3s;
        border-color: #cd7f32;
        background: linear-gradient(135deg, #fef3e2 0%, white 50%);
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .result-card:hover {
        border-color: var(--primary-color);
        transform: translateY(-4px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    }

    /* New two-column result card layout */
    .result-card {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .result-card-left {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 50px;
    }

    .result-card-left .rank-number {
        font-size: 2rem;
        font-weight: 800;
        color: var(--text-gray);
    }

    .result-card:nth-child(1) .rank-number {
        color: #f59e0b;
    }

    .result-card:nth-child(2) .rank-number {
        color: #64748b;
    }

    .result-card:nth-child(3) .rank-number {
        color: #b87333;
    }

    .result-card-right {
        flex: 1;
        min-width: 0;
    }

    .result-card-name {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .result-card-info {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .result-card-info .status-badge {
        font-size: 0.7rem;
    }

    .result-card-info .distance-badge {
        font-size: 0.7rem;
    }

    .result-card-info .category-text {
        color: var(--text-gray);
        font-size: 0.8rem;
    }

    /* No Result */
    .no-result-area {
        text-align: center;
        padding: 40px 20px;
    }

    .no-result-icon {
        font-size: 3rem;
        margin-bottom: 16px;
    }

    .no-result-area p {
        color: var(--text-gray);
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .no-result-hint {
        font-size: 0.85rem !important;
        color: var(--text-gray);
    }

    /* Random Action Buttons */
    .random-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .random-btn {
        padding: 16px 24px;
        border: none;
        border-radius: 14px;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.2s ease;
        font-family: inherit;
    }

    .random-btn.primary {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        color: white;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    }

    .random-btn.primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
    }

    .random-btn.secondary {
        background: var(--bg-light);
        color: var(--text-dark);
        border: 2px solid #e5e7eb;
    }

    .random-btn.secondary:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
    }

    .random-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none !important;
    }

    /* Mobile Responsive */
    @media (max-width: 768px) {
        .random-modal-container {
            max-width: 100%;
            border-radius: 20px 20px 0 0;
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            max-height: 85vh;
        }
    }






}

/* ==========================================
   Login Modal & Google Button Styles
   ========================================== */

#login-modal .modal-content {
    background: white;
    padding: 32px 24px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    width: 90%;
    max-width: 360px;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 14px 24px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 100px;
    /* Pill shape */
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.google-login-btn:hover {
    background: #f8faff;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
    border-color: #d2e3fc;
    transform: translateY(-1px);
}

.google-login-btn:active {
    background: #f1f3f4;
    box-shadow: none;
    transform: translateY(0);
}

.google-login-btn img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.google-login-btn span {
    flex-grow: 1;
    text-align: center;
}

/* Ensure modal overlay is dark enough */
.modal-overlay {
    background-color: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    /* Ensure on top */
}

/* User Status in Header */
.user-info {
    display: flex;
    align-items: center;
}

.user-greeting {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-action-btn {
    font-size: 0.8rem;
    padding: 5px 12px !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    font-weight: 700;
    color: var(--primary-color);
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-action-btn:hover {
    background: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    color: var(--primary-dark);
}

/* ===== User Location Marker (Global) ===== */
.user-marker {
    background: transparent !important;
    border: none !important;
}

.user-marker-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-marker-pulse {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(66, 133, 244, 0.3);
    border-radius: 50%;
    animation: userPulse 2s ease-out infinite;
}

@keyframes userPulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.user-marker-dot {
    position: relative;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4285f4 0%, #1a73e8 100%);
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.5);
    z-index: 10;
}

/* ===== App Button (Global) ===== */
.app-btn {
    margin-top: 24px;
    width: 100%;
    padding: 14px;
    background: white;
    color: #1e3042;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.app-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.app-btn.install {
    background: #ff6b35;
    color: white;
    margin: 24px auto 0 auto;
    /* Center horizontally and add top spacing */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 40px;
    /* Larger padding for bigger click area */
    font-size: 1.1rem;
    /* Larger font */
    width: fit-content;
    /* Fit to content but allow min-width */
    min-width: 240px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* ===== PWA Install Modal - Dark Theme (Global) ===== */
#install-modal .modal-content {
    background: rgba(30, 48, 66, 0.95);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
}

#install-modal .modal-title {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 24px;
    line-height: 1.4;
}

#install-modal .modal-close {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
}

#install-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.install-guides {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.guide-item h4 {
    color: #ffd700;
    /* Gold-ish for premium feel */
    margin-bottom: 6px;
    font-size: 1rem;
    font-weight: 600;
}

.guide-item p {
    color: #e5e7eb;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== Holiday Banner & Status Styles (Global) ===== */
.holiday-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 10px 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: #92400e;
    border-bottom: 1px solid #fcd34d;
    z-index: 998;
    flex-shrink: 0;
    animation: holidayPulse 3s ease-in-out infinite;
}

@keyframes holidayPulse {

    0%,
    100% {
        background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    }

    50% {
        background: linear-gradient(135deg, #fde68a 0%, #fef3c7 100%);
    }
}

/* Holiday Status Badges */
.holiday-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
}

.holiday-normal {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.holiday-closed {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.holiday-call {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ===== Welcome Location Modal (Global) ===== */
.welcome-modal-container {
    background: white;
    border-radius: 24px;
    max-width: 380px;
    width: 100%;
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.welcome-modal-container h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

#modal-desc {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.6;
    white-space: pre-wrap;
    /* Enable line breaks */
}

.welcome-desc {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 24px;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    text-align: left;
}

.welcome-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 12px;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.welcome-feature span:first-child {
    font-size: 1.2rem;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.welcome-btn {
    padding: 16px 24px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.welcome-btn.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}

.welcome-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.welcome-btn.secondary {
    background: transparent;
    color: var(--text-gray);
    font-weight: 500;
}

.welcome-btn.secondary:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .welcome-modal-container {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

/* ===== Sidebar Navigation ===== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-container {
    position: fixed;
    top: 0;
    right: -300px;
    /* Hidden by default */
    width: 280px;
    height: 100%;
    background: white;
    z-index: 2001;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-container.active {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    border-bottom: 1px solid #eee;
}

.sidebar-close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    padding: 4px;
}

.sidebar-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Sidebar Profile */
.sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.profile-img-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-nickname {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.sidebar-auth-btn {
    padding: 8px 24px;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-auth-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Sidebar Stats */
.sidebar-stats {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    background: #f8fafc;
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
    flex: 1;
}

.stat-item:hover {
    background: #e2e8f0;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-gray);
}

/* Sidebar Menu */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-dark);
    font-weight: 500;
    text-decoration: none;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

.menu-item:hover {
    background: #f3f4f6;
}

.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Sidebar Language Select */
.sidebar-lang-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 8px;
    background: white;
}

/* Leaflet Popup Override */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    /* Remove default padding */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
    margin: 12px 16px 12px 16px !important;
    /* Reduce top margin */
    width: 280px !important;
}

.leaflet-popup-tip {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.leaflet-container a.leaflet-popup-close-button {
    top: 8px;
    right: 8px;
    padding: 4px;
    color: #999;
    font-size: 16px;
    font-weight: bold;
}

/* ===== Popup Customization ===== */
.leaflet-popup-content-wrapper {
    padding: 0 !important;
    border-radius: 12px;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 10px 0 0 0 !important;
    /* Top margin reduced */
    width: 280px !important;
}

/* Ensure content inside popup has padding where needed */
.restaurant-popup .popup-content {
    padding: 12px 16px;
}

/* ===== Sidebar QR Code ===== */
.sidebar-qr-container {
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #fafafa;
}

.qr-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
    font-weight: 500;
}

.sidebar-qr-code {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Soft shadow */
    background: white;
    padding: 8px;
    /* White border effect */
}

/* List View Icons */
.title-icons {
    margin-right: 4px;
}

.title-heart,
.title-like {
    display: inline;
    margin-right: 2px;
    font-size: 1em;
    vertical-align: baseline;
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 16px;
    position: fixed;
    z-index: 3000;
    left: 50%;
    bottom: 80px;
    /* Center bottom, above floating buttons */
    transform: translateX(-50%);
    font-size: 0.95rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 90px;
    /* Slight slide up effect */
}

/* Random Result Cards */
.result-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid #e0e0e0;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.result-card:nth-child(1) {
    border-left-color: #ff6b35;
    background: linear-gradient(to right, #fff8f5 0%, #ffffff 100%);
}

.result-card:nth-child(2) {
    border-left-color: #ffa500;
}

.result-card:nth-child(3) {
    border-left-color: #ffd700;
}

.result-card-left {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rank-number {
    font-size: 2rem;
    font-weight: 700;
    color: #ff6b35;
}

.result-card:nth-child(2) .rank-number {
    color: #888;
}

.result-card:nth-child(3) .rank-number {
    color: #aaa;
}

.result-card-right {
    flex: 1;
    min-width: 0;
}

.result-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-card-info .status-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
}

.result-card-info .distance-badge {
    font-size: 0.8rem;
    color: #ff6b35;
    font-weight: 500;
}

.result-card-info .category-text {
    font-size: 0.8rem;
    color: #888;
}