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

:root {
    --bg:        #121220;
    --surface:   #1c1c2e;
    --card:      #252538;
    --accent:    white;
    --accent2:   lightgrey;
    --text:      #e4e4ed;
    --muted:     #8e8ea0;
    --border:    #333350;
    --radius:    12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #000080 0%, #202A44 100%);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px 14px;
    text-align: center;
}
.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}
.tagline {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    background: var(--surface);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.tab {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    padding: 8px 24px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active {
    background: var(--accent);
    color: #000;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

#tab-map {
    display: none;
    height: calc(100vh - 120px);
}
#tab-map.active {
    display: flex;
}

#map {
    flex: 1;
    min-height: 400px;
}

#bar-list {
    width: 340px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px;
}
#bar-list h2 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--accent);
}

.bar-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--border);
}
.bar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border-color: var(--accent);
}
.bar-card h3 {
    font-size: 15px;
    margin-bottom: 4px;
}
.bar-address {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}
.bar-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.bar-meta a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.feed-container, .post-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 16px;
}
.feed-container h2, .post-container h2 {
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 16px;
}

.feed-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.feed-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}
.feed-header strong { color: var(--accent); }
.feed-time { font-size: 12px; color: var(--muted); }
.feed-ratings {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.feed-ratings span { white-space: nowrap; }
.feed-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

#review-form select,
#review-form textarea {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 12px;
    font-size: 14px;
    margin-bottom: 16px;
    font-family: inherit;
}
#review-form select:focus,
#review-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.rating-group {
    margin-bottom: 16px;
}
.rating-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--muted);
}

.stars {
    display: flex;
    gap: 4px;
}
.stars span {
    font-size: 28px;
    cursor: pointer;
    color: var(--border);
    transition: color 0.15s;
}
.stars span:hover,
.stars span.selected {
    color: var(--accent);
}

.traffic-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.traffic-btn {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}
.traffic-btn:hover { border-color: var(--accent); }
.traffic-btn.active {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.15);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.submit-btn:hover {
    background: var(--accent2);
}

.loading, .placeholder-msg, .error {
    text-align: center;
    color: var(--muted);
    padding: 32px 0;
    font-size: 14px;
}
.error { color: #ef4444; }

/* Olivia Chat Bubble */
#olivia-bubble {
    position: fixed;
    bottom: 28px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1565c0;
    border-radius: 50px;
    padding: 10px 14px 10px 18px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(21, 101, 192, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}
#olivia-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(21, 101, 192, 0.7);
}
.olivia-label {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.olivia-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
    flex-shrink: 0;
}

/* Olivia Chat Window */
#olivia-chat {
    position: fixed;
    bottom: 90px;
    left: 24px;
    width: 340px;
    max-height: 480px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    z-index: 999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
}
.olivia-chat-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(12px) !important;
}
.olivia-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #1565c0;
    flex-shrink: 0;
}
.olivia-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.olivia-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.7);
}
.olivia-name {
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}
.olivia-status {
    color: rgba(255,255,255,0.75);
    font-size: 11px;
}
.olivia-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.olivia-close:hover { background: rgba(255,255,255,0.15); }

.olivia-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.olivia-msg {
    max-width: 88%;
    font-size: 13px;
    line-height: 1.5;
    padding: 9px 12px;
    border-radius: 12px;
}
.olivia-msg p { margin: 0; }
.olivia-msg-ai {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.olivia-msg-user {
    background: #1565c0;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.olivia-msg-typing {
    color: var(--muted);
    font-style: italic;
}

.olivia-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.olivia-input-row input {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    padding: 8px 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.olivia-input-row input:focus { border-color: #1565c0; }
.olivia-input-row button {
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.olivia-input-row button:hover { background: #1976d2; }
.olivia-input-row button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 768px) {
    #tab-map.active {
        flex-direction: column;
        height: auto;
    }
    #map {
        height: 50vh;
    }
    #bar-list {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: 45vh;
    }
}
