/* =====================
   CSS VARIABLES
   ===================== */
:root {
    --dark-bg:    #0B0C10;
    --card-bg:    #11131C;
    --gold:       #C9A84C;
    --gold-light: #E8D5A3;
    --gold-dim:   rgba(201, 168, 76, 0.18);
    --cream:      #F5F0E8;
    --muted:      #7A7565;
    --border:     rgba(201, 168, 76, 0.22);
    --font-serif: 'Cinzel', Georgia, serif;
    --font-deco:  'Cinzel Decorative', serif;
    --font-sans:  'Pretendard', 'Roboto', sans-serif;
}

/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--dark-bg);
    color: var(--cream);
    font-family: var(--font-sans);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

/* =====================
   PAGE BACKGROUND
   ===================== */
.page-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse at 15% 50%, rgba(201,168,76,0.05) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 15%, rgba(201,168,76,0.04) 0%, transparent 50%),
        linear-gradient(180deg, #0B0C10 0%, #0E0F18 100%);
    pointer-events: none;
}

/* =====================
   LAYOUT
   ===================== */
.map-section {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 40px 24px 48px;
}

/* =====================
   HEADER
   ===================== */
.page-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.header-ornament {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
}

.header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.header-diamond {
    width: 6px;
    height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
    flex-shrink: 0;
}

.page-title {
    font-family: var(--font-deco);
    font-size: 26px;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 3px;
}

.page-subtitle {
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 2px;
    font-weight: 300;
}

/* =====================
   MAP WRAPPER
   ===================== */
.map-wrapper {
    position: relative;
    display: inline-block;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #0D0E16;
    box-shadow:
        0 0 0 1px rgba(201,168,76,0.08),
        0 30px 80px rgba(0,0,0,0.7),
        0 0 60px rgba(201,168,76,0.06);
}

.map-image {
    display: block;
    width: 840px;
    max-width: calc(100vw - 64px);
    height: auto;
    border-radius: 4px;
    filter: brightness(0.88) contrast(1.06) saturate(0.9);
}

/* =====================
   HOTSPOTS
   ===================== */
.hotspot {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #B22238; /* Burgundy Red */
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    box-shadow:
        0 0 0 2px rgba(178, 34, 56, 0.35),
        0 0 14px rgba(178, 34, 56, 0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hotspot::before,
.hotspot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1px solid rgba(178, 34, 56, 0.7);
    transform: translate(-50%, -50%);
    animation: ring-pulse 2.8s ease-out infinite;
}

.hotspot::after {
    animation-delay: 1.4s;
}

@keyframes ring-pulse {
    0%   { width: 14px;  height: 14px;  opacity: 0.9; }
    100% { width: 48px;  height: 48px;  opacity: 0;   }
}

.hotspot:hover {
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow:
        0 0 0 3px rgba(178, 34, 56, 0.5),
        0 0 24px rgba(178, 34, 56, 0.7);
}

.spot-label {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 11, 18, 0.9);
    color: #FDFAF3;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none; /* Let the hotspot handle clicks/hovers */
    white-space: nowrap;
    border: 1px solid rgba(178, 34, 56, 0.5);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.hotspot:hover .spot-label {
    opacity: 1;
}

/* =====================
   PAGE FOOTER
   ===================== */
.page-footer {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-family: var(--font-sans);
    opacity: 0.7;
}

/* =====================
   TOOLTIP SHELL
   ===================== */
.whisky-tooltip {
    position: fixed;
    width: 480px;
    max-height: 600px;
    background: #FDFAF3;
    border: 1.5px solid #C9A84C;
    border-radius: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 2000;
    cursor: grab;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.35),
        0 4px 16px rgba(0,0,0,0.15),
        0 0 0 1px rgba(201,168,76,0.2);
    opacity: 0;
    transform: scale(0.96);
    transform-origin: left center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.whisky-tooltip.show {
    opacity: 1;
    transform: scale(1);
}

.whisky-tooltip:active { cursor: grabbing; }

.whisky-tooltip::-webkit-scrollbar { width: 4px; }
.whisky-tooltip::-webkit-scrollbar-track { background: rgba(201,168,76,0.08); }
.whisky-tooltip::-webkit-scrollbar-thumb {
    background: rgba(201,168,76,0.5);
    border-radius: 10px;
}

/* =====================
   REGION HEADER (sticky)
   ===================== */
.region-header {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 16px 20px 13px;
    background: linear-gradient(135deg, #8B1C31 0%, #B22238 100%);
    border-bottom: 1px solid rgba(139,28,49,0.4);
}

.region-name {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: #FDFAF3;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.region-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.region-sub {
    font-size: 11px;
    color: rgba(253, 250, 243, 0.85);
    letter-spacing: 1px;
}

.region-dot {
    width: 3px;
    height: 3px;
    background: rgba(253, 250, 243, 0.6);
    border-radius: 50%;
}

.region-count {
    font-size: 11px;
    color: rgba(253, 250, 243, 0.85);
    letter-spacing: 0.5px;
}

/* =====================
   WHISKY CARDS
   ===================== */
.whisky-cards-container {
    padding: 8px 0 8px;
}

.whisky-card {
    display: flex;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    align-items: flex-start;
    transition: background 0.2s ease, transform 0.2s ease;
}

.whisky-card:last-child { border-bottom: none; }

.whisky-card {
    cursor: pointer;
}

.whisky-card:hover {
    background: rgba(201,168,76,0.1);
    transform: translateX(4px);
}

.ai-hint {
    font-size: 10.5px;
    color: #8A5E10;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.whisky-card:hover .ai-hint {
    opacity: 1;
}

/* =====================
   BOTTLE IMAGE
   ===================== */
.bottle-img-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 108px;
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(201,168,76,0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bottle-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

.bottle-fallback {
    font-size: 26px;
    line-height: 1;
}

/* =====================
   CARD CONTENT
   ===================== */
.card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.whisky-name {
    font-family: var(--font-serif);
    font-size: 13.5px;
    font-weight: 600;
    color: #1A1208;
    line-height: 1.35;
}

.whisky-info {
    font-size: 10.5px;
    color: #8A7D60;
    letter-spacing: 0.5px;
}

/* =====================
   STAT BARS
   ===================== */
.whisky-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.stat-label {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #8A7D60;
    width: 40px;
    flex-shrink: 0;
    font-family: var(--font-sans);
}

.stat-bar-track {
    flex: 1;
    height: 3px;
    background: rgba(0,0,0,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #A07828, #C9A84C);
    border-radius: 2px;
}

.stat-value {
    font-size: 10px;
    color: #8A5E10;
    font-weight: 700;
    width: 22px;
    text-align: right;
    flex-shrink: 0;
}

/* =====================
   DESCRIPTION
   ===================== */
.whisky-desc {
    font-size: 11.5px;
    color: rgba(26,18,8,0.6);
    line-height: 1.65;
}

/* =====================
   AI CHAT WIDGET
   ===================== */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #C9A84C 0%, #E2C97A 100%);
    color: #1A1208;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(201,168,76,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(201,168,76,0.5);
}

.chat-widget {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: #FDFAF3;
    border: 1.5px solid #C9A84C;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 0 1px rgba(201,168,76,0.2);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    overflow: hidden;
    animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
    background: linear-gradient(135deg, #1A1208 0%, #2A1F12 100%);
    color: #E8D5A3;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #C9A84C;
}

.chat-header h3 {
    font-family: var(--font-serif);
    font-size: 16px;
    margin: 0;
    letter-spacing: 1px;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: #E8D5A3;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.chat-close-btn:hover { opacity: 1; }

.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fdfaf3;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.ai-message { align-self: flex-start; }
.user-message { align-self: flex-end; }

.ai-message .message-content {
    background: rgba(201, 168, 76, 0.15);
    color: #1A1208;
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 10px 10px 10px 0;
}

.user-message .message-content {
    background: linear-gradient(135deg, #1A1208 0%, #2A1F12 100%);
    color: #FDFAF3;
    border-radius: 10px 10px 0 10px;
}

.message-content {
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
}

.message-content strong { color: #8A5E10; }
.user-message .message-content strong { color: #C9A84C; }

.chat-footer {
    padding: 14px 20px;
    background: #Fcf9f0;
    border-top: 1px solid rgba(201,168,76,0.3);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#chat-input {
    flex: 1;
    background: #ffffff;
    border: 1px solid rgba(201,168,76,0.6);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 13.5px;
    color: #1A1208;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    outline: none;
    transition: border-color 0.2s ease;
}

#chat-input:focus { border-color: #C9A84C; box-shadow: 0 0 0 2px rgba(201,168,76,0.15); }

.chat-send-btn {
    background: #C9A84C;
    color: #1A1208;
    border: none;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.1s ease, background 0.2s ease;
}

.chat-send-btn:hover { background: #E2C97A; }
.chat-send-btn:active { transform: scale(0.95); }
.chat-send-btn:disabled { background: #cccccc; cursor: not-allowed; }
