@charset "UTF-8";

/* Custom Styles extracted from index.html */

:root {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    line-height: 1.4;
}

button,
input,
textarea,
select {
    font: inherit;
    line-height: 1.2;
}

img,
svg {
    display: block;
}

svg {
    flex-shrink: 0;
}

#app {
    height: 100vh;
    height: 100dvh;
}

.safe-header {
    padding-top: calc(1rem + env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

#searchInput {
    -webkit-appearance: none;
    appearance: none;
    line-height: normal;
}

.chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.chip-label {
    display: block;
    line-height: 1.2;
    text-align: center;
}

/* Modern Squircle Marker */
.nmap-marker {
    width: 34px;
    height: 34px;
    position: relative;
    cursor: pointer;
    transition: box-shadow 0.3s ease, border 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transform-origin: center center;
}

.nmap-marker::before {
    content: "";
    position: absolute;
    inset: 0;
    background: white;
    border-radius: 10px;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
    transition: inherit;
}

.nmap-marker::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #FFFFFF;
    transition: inherit;
}

.nmap-marker[data-cat="식당"]::before {
    background: #F4AFA0;
}

.nmap-marker[data-cat="생활형"]::before {
    background: #A8D8C9;
}

.nmap-marker[data-cat="간식"]::before {
    background: #F6D267;
}

.nmap-marker[data-cat="엽전"]::before {
    background: #FF922B;
}

/* Dot Mode Overrides */
.nmap-marker.dot-mode {
    width: 14px !important;
    height: 14px !important;
    border-radius: 50% !important;
    border: 2px solid #FFFFFF !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25) !important;
    background: #999;
    /* Fallback */
}

.nmap-marker.dot-mode::before,
.nmap-marker.dot-mode::after,
.nmap-marker.dot-mode .glyph-container,
.nmap-marker.dot-mode .shop-label {
    display: none !important;
    opacity: 0 !important;
}

.nmap-marker.dot-mode[data-cat="식당"] {
    background: #F4AFA0;
}

.nmap-marker.dot-mode[data-cat="생활형"] {
    background: #A8D8C9;
}

.nmap-marker.dot-mode[data-cat="간식"] {
    background: #F6D267;
}

.nmap-marker.dot-mode[data-cat="엽전"] {
    background: #FF922B;
}

.nmap-marker.active {
    transform: translateY(-12px) scale(1.2);
    z-index: 100;
}

.nmap-marker.active::before {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border: 5px solid #1A1A1B;
}

.nmap-marker.active::after {
    border-top-color: #1A1A1B;
    bottom: -7px;
}

.fav-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #EC4899;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.nmap-marker.is-favorite .fav-badge {
    opacity: 1;
    transform: scale(1);
}

.fav-badge svg {
    width: 10px;
    height: 10px;
}

.glyph-container {
    position: relative;
    z-index: 2;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glyph {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0);
}

.nmap-marker.dim {
    opacity: 0.15;
    filter: grayscale(1);
    transform: scale(0.8);
    /* For debugging/visibility if needed */
}

.shop-label {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    color: #1A1A1B;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.04);
    opacity: 1;
}

.nmap-marker:hover:not(.dot-mode) .shop-label {
    opacity: 1;
    bottom: -38px;
}

.shop-label.pos-top {
    bottom: auto;
    top: -34px;
}

.nmap-marker:hover:not(.dot-mode) .shop-label.pos-top {
    bottom: auto;
    top: -38px;
}

.shop-label.pos-right {
    left: 100%;
    bottom: auto;
    top: 50%;
    transform: translate(12px, -50%);
}

.nmap-marker:hover:not(.dot-mode) .shop-label.pos-right {
    bottom: auto;
    top: 50%;
    transform: translate(16px, -50%);
}

.shop-label.pos-left {
    left: 0;
    bottom: auto;
    top: 50%;
    transform: translate(-12px, -50%) translateX(-100%);
}

.nmap-marker:hover:not(.dot-mode) .shop-label.pos-left {
    bottom: auto;
    top: 50%;
    transform: translate(-16px, -50%) translateX(-100%);
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.panel-transition {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden-panel-right {
    transform: translateX(100%);
}

.hidden-panel-left {
    transform: translateX(-100%);
}

/* Mobile Bottom Sheet Styles */
@media (max-width: 639px) {
    #detailPanel {
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        border-radius: 24px 24px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15) !important;
        /* Default position is off screen at the bottom */
        transform: translateY(100vh);
        /* Dragging requires disabling default transition */
        will-change: transform;
    }

    /* When hidden on mobile, push completely down */
    #detailPanel.hidden-panel-right {
        transform: translateY(100vh) !important;
    }
}

#langMenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 9999;
    max-height: none;
    overflow: visible;
}

#langMenu button {
    min-height: 44px;
}

@font-face {
    font-family: 'Jandari';
    src: local('HSJandari-Regular'),
        local('HS Jandari'),
        url('assets/HSJandari-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.detail-store-name,
h1,
h2 {
    font-family: 'Jandari', sans-serif !important;
}

/* Map Legend Panel */
.map-legend {
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom) + 80px);
    left: 1rem;
    z-index: 25;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.04);
    max-width: 280px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-legend.collapsed {
    padding: 12px;
}

.map-legend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.map-legend.collapsed .map-legend-header {
    margin-bottom: 0;
}

.map-legend-title {
    font-size: 13px;
    font-weight: 800;
    color: #1A1A1B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-legend-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    color: #6B7280;
    background: transparent;
    border: none;
    cursor: pointer;
}

.map-legend-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.map-legend-content {
    display: grid;
    gap: 10px;
}

.map-legend.collapsed .map-legend-content {
    display: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.legend-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.legend-icon img {
    width: 16px;
    height: 16px;
    filter: brightness(0);
}

.legend-label {
    font-weight: 700;
    color: #4B5563;
}

/* Help Tooltip */
.help-tooltip {
    position: relative;
    display: inline-block;
}

.help-tooltip-trigger {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(166, 138, 100, 0.1);
    color: #A68A64;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    cursor: help;
    transition: all 0.2s;
}

.help-tooltip-trigger:hover {
    background: rgba(166, 138, 100, 0.2);
    transform: scale(1.1);
}

.help-tooltip-content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1A1A1B;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.help-tooltip:hover .help-tooltip-content {
    opacity: 1;
}

/* Error Message */
.error-message {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.error-message-title {
    font-weight: 800;
    margin-bottom: 4px;
}

.error-message-text {
    font-weight: 500;
}

/* Operating Hours Component (Naver/Kakao Style) */
.hours-container {
    padding: 0.25rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.hours-container:hover {
    background-color: #f8fafc;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.status-open-text {
    color: #166534;
}

.status-closed-text {
    color: #991b1b;
}

.status-ended-text {
    color: #475569;
}

.status-break-text {
    color: #9a3412;
}

.dot-open {
    background-color: #22c55e;
}

.dot-closed {
    background-color: #ef4444;
}

.dot-ended {
    background-color: #94a3b8;
}

.dot-break {
    background-color: #f97316;
}

.hours-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.hours-table tr {
    border-bottom: 1px solid #f1f5f9;
}

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

.hours-table td {
    padding: 8px 4px;
}

.hours-table tr.today {
    font-weight: 700;
    color: #A68A64;
    background-color: #FDFBF7;
}

.hours-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    margin-right: 4px;
}

.badge-break {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}

.badge-last {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

#hoursToggleBtn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#hoursToggleBtn.active svg {
    transform: rotate(180deg);
}

/* ======================================================
   Marker Show / Hide Animations
   ====================================================== */

/* Pop-In: fade in only — no scale to avoid size conflict */
@keyframes markerPopIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Fade-Out: smoothly fade out */
@keyframes markerFadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.nmap-marker.marker-show {
    animation: markerPopIn 0.2s ease-out both;
}

.nmap-marker.marker-hide {
    animation: markerFadeOut 0.2s ease-out both;
    pointer-events: none;
}

/* ======================================================
   Radar Cone Ripple Wave (User Location Compass Mode)
   ====================================================== */

@keyframes radarRipple {
    0% {
        transform: scale(0.6);
        opacity: 0.7;
    }

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

.user-radar-ripple {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.5);
    animation: radarRipple 1.6s ease-out infinite;
    pointer-events: none;
}

.user-radar-ripple:nth-child(2) {
    animation-delay: 0.55s;
}

.user-radar-ripple:nth-child(3) {
    animation-delay: 1.1s;
}