/* Traviis Web App - Clean, Uncluttered Design */

/* ========== CSS Variables ========== */
:root {
    --primary: #01f1f1;
    --primary-hover: #00d4d4;
    --background: #0a0a0a;
    --surface: rgba(20, 20, 20, 0.98);
    --panel-bg: rgba(15, 15, 15, 0.98);
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --border: rgba(255, 255, 255, 0.1);
    --success: #4caf50;
    --danger: #ff4444;
    --header-height: 50px;
    --status-height: 30px;
    --panel-width: 360px;
    --z-header: 1000;
    --z-panels: 900;
    --z-fab: 800;
    --z-status: 700;
    --z-mobile-menu: 1100;
}

/* ========== Reset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    position: relative;
}

/* ========== Loading Screen ========== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 2rem;
}

.loading-text {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========== App Container ========== */
.app-container {
    position: relative;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* ========== Header Bar ========== */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: var(--z-header);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    height: 30px;
    width: auto;
}

.app-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

/* ========== Desktop Menu ========== */
.desktop-menu {
    display: none;
    gap: 0.5rem;
}

.menu-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: rgba(1, 241, 241, 0.1);
    color: var(--primary);
}

.menu-item.active {
    background: rgba(1, 241, 241, 0.15);
    color: var(--primary);
}

.menu-icon {
    font-size: 1.2rem;
}

.menu-label {
    font-size: 0.9rem;
}

/* ========== Mobile Menu Toggle ========== */
.mobile-menu-toggle {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

/* ========== Map Container ========== */
.map-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: var(--status-height);
    z-index: 1;
}

/* ========== Floating Action Buttons ========== */
.fab-container {
    position: fixed;
    bottom: calc(var(--status-height) + 1rem);
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: var(--z-fab);
}

.fab {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.fab:hover {
    transform: scale(1.1);
}

.fab:active {
    transform: scale(0.95);
}

.fab-primary {
    background: var(--primary);
    color: var(--background);
}

.fab-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.fab span {
    font-size: 1.3rem;
}

/* ========== Panels (Hidden by Default) ========== */
.panel {
    position: fixed;
    top: var(--header-height);
    background: var(--panel-bg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: var(--z-panels);
    display: none;
    flex-direction: column;
    max-height: calc(100vh - var(--header-height) - var(--status-height));
}

.panel.active {
    display: flex;
}

.panel-left {
    left: 0;
    width: var(--panel-width);
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.panel-right {
    right: 0;
    width: var(--panel-width);
    border-right: none;
    border-radius: 12px 0 0 12px;
}

.panel-center {
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    margin-top: 1rem;
}

.panel-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 1.1rem;
    color: var(--primary);
}

.panel-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.panel-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.panel-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

/* ========== Search Panel ========== */
.search-container {
    margin-bottom: 1rem;
}

.search-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-filters input[type="range"] {
    width: 100%;
}

/* ========== Places Panel ========== */
.poi-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

.discover-btn {
    background: var(--primary);
    color: var(--background);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.discover-btn:hover {
    background: var(--primary-hover);
}

.poi-item {
    background: #1a1a1a !important;  /* Very dark background with !important */
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(1, 241, 241, 0.3);
    color: #ffffff !important;  /* Force white text */
}

.poi-item * {
    color: inherit !important;  /* All child elements inherit white color */
}

.poi-item:hover {
    background: #2a2a2a !important;  /* Slightly lighter on hover */
    border-color: var(--primary);
    transform: translateX(5px);
}

.poi-name {
    color: #ffffff !important;  /* Force white text */
    font-weight: 600;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);  /* Add shadow for better contrast */
}

.poi-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: #cccccc !important;  /* Force light gray */
    font-size: 0.875rem;
}

.poi-distance {
    color: #01f1f1 !important;  /* Force cyan */
    font-weight: 500;
}

.poi-category {
    color: #aaaaaa !important;  /* Force medium gray */
    text-transform: capitalize;
}

/* Ensure text is visible in all states */
.poi-list {
    color: #ffffff !important;
}

.panel-content {
    color: #ffffff !important;
}

/* ========== Navigation Panel ========== */
.navigation-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

/* ========== Narration Panel ========== */
.narration-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.toggle-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.slider-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-control span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.slider-control input[type="range"] {
    width: 100%;
}

.now-playing {
    background: rgba(1, 241, 241, 0.1);
    border: 1px solid var(--primary);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.playing-icon {
    font-size: 1.5rem;
    animation: pulse 2s ease infinite;
}

.playing-info {
    flex: 1;
}

.playing-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.playing-location {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========== Settings Panel ========== */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h4 {
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.map-style-options {
    display: flex;
    gap: 0.5rem;
}

.style-option {
    flex: 1;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.style-option:hover {
    background: rgba(1, 241, 241, 0.1);
}

.style-option.active {
    background: var(--primary);
    color: var(--background);
    border-color: var(--primary);
}

.settings-btn {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.settings-btn:hover {
    background: rgba(1, 241, 241, 0.1);
}

.settings-btn.danger {
    border-color: var(--danger);
    color: var(--danger);
}

.settings-btn.danger:hover {
    background: rgba(255, 68, 68, 0.1);
}

.spoof-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.spoof-controls input {
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
}

.spoof-controls button {
    padding: 0.5rem;
    background: var(--primary);
    color: var(--background);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

/* ========== Mobile Menu ========== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    flex-direction: column;
}

.mobile-menu.active {
    display: flex !important;
}

.mobile-menu-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-header span {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
}

.mobile-menu-items {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(1, 241, 241, 0.2);
    color: var(--text);
    padding: 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    font-weight: 500;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    background: rgba(1, 241, 241, 0.25);
    border-color: var(--primary);
    transform: translateX(5px);
}

.mobile-menu-item .menu-icon {
    font-size: 1.5rem;
}

/* ========== Audio Player UI ========== */
.audio-player-ui {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(1, 241, 241, 0.3);
    z-index: 1001;
    transition: bottom 0.3s ease;
    max-width: 90%;
    width: auto;
}

.audio-player-ui.visible {
    bottom: 60px;
}

.audio-player-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.audio-play-btn {
    background: var(--primary);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    color: var(--text-on-primary);
}

.audio-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(1, 241, 241, 0.6);
}

.audio-play-btn.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(1, 241, 241, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(1, 241, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(1, 241, 241, 0);
    }
}

.audio-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 150px;
}

.audio-title {
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.audio-status {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.audio-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.audio-close-btn:hover {
    opacity: 1;
}

/* ========== Status Bar ========== */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--status-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: var(--z-status);
    font-size: 0.85rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.status-icon {
    font-size: 0.9rem;
}

/* ========== Responsive Design ========== */

/* Mobile (default) */
@media (max-width: 767px) {
    .desktop-menu {
        display: none !important;
    }

    .panel-left,
    .panel-right {
        width: 100%;
        border-radius: 0;
    }

    .panel-center {
        width: 100%;
        max-width: none;
        border-radius: 0;
        margin-top: 0;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .desktop-menu {
        display: flex;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .menu-label {
        display: none;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .desktop-menu {
        display: flex;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .fab-container {
        flex-direction: row;
        bottom: calc(var(--status-height) + 1rem);
        right: 2rem;
    }

    .panel {
        top: calc(var(--header-height) + 1rem);
        max-height: calc(100vh - var(--header-height) - var(--status-height) - 2rem);
    }

    .panel-left {
        left: 1rem;
    }

    .panel-right {
        right: 1rem;
    }
}

/* ========== Animations ========== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== Utility Classes ========== */
.hidden {
    display: none !important;
}

.visible {
    display: flex !important;
}

/* Override Mapbox styles for cleaner look */
.mapboxgl-ctrl-geocoder {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

.mapboxgl-ctrl-geocoder input {
    color: var(--text) !important;
}

.mapboxgl-ctrl-geocoder .suggestions {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
}

.mapboxgl-ctrl-directions {
    background: var(--surface) !important;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: calc(var(--status-height) + 3rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--background);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}