/**
 * Podcast Map 3D Visualization Styles
 * Clean, elegant, full-window 3D experience with auto-rotation
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #0a0e1a;
    color: #ffffff;
    overflow: hidden;
}

/* Main container - full viewport */
#podcast-map-3d-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header section - two rows on desktop */
.map-header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(10, 14, 26, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.project-selector {
    grid-column: 1;
    grid-row: 1;
}

.header-controls {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: flex-end;
}

.nav-link {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

/* Project selector - elegant and clean */
.project-selector {
    position: relative;
}

.project-dropdown-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.project-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.project-name {
    letter-spacing: -0.2px;
}

.dropdown-arrow {
    font-size: 11px;
    opacity: 0.5;
    transition: transform 0.3s ease;
}

/* Cluster control - slider for 9 vs 18 clusters */
.cluster-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.cluster-control label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.cluster-control #cluster-count {
    color: #ffffff;
    font-weight: 600;
}

.cluster-control input[type="range"] {
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.cluster-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
}

.cluster-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile controls container - full width second row on desktop */
.mobile-controls {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Episode and topic filters - clean dropdowns */
.episode-filter,
.topic-filter {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
}

.episode-dropdown,
.topic-dropdown {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 40px 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s ease;
    font-weight: 400;
}

.episode-dropdown option,
.topic-dropdown option {
    background: #1a1f2e;
    color: #ffffff;
}

.episode-dropdown:hover,
.topic-dropdown:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.episode-dropdown:focus,
.topic-dropdown:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.episode-filter .dropdown-arrow,
.topic-filter .dropdown-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.4;
}

/* 3D Graph container - full height below header */
#3d-graph {
    flex: 1;
    position: relative;
    width: 100%;
    background: radial-gradient(ellipse at center, #1a1f2e 0%, #0a0e1a 100%);
}


/* Controls hint */
.controls-hint {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    background: rgba(10, 14, 26, 0.8);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 5;
}

.controls-hint p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Audio player - elegant left-side overlay */
.audio-player-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 420px;
    height: 100vh;
    background: rgba(10, 14, 26, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px 24px;
    padding-top: 100px;
    backdrop-filter: blur(20px);
    z-index: 90;
    animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.player-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.close-player {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-player:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.episode-info {
    width: 100%;
    margin-bottom: 24px;
}

.episode-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
    color: #ffffff;
}

.episode-info p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.audio-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#audio-element {
    width: 100%;
    height: 48px;
    border-radius: 8px;
}

.playback-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.time-display {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-control label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.speed-control select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.speed-control select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.speed-control select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.speed-control option {
    background: #1a1f2e;
    color: #ffffff;
}

/* Responsive design - smooth scaling */
@media (max-width: 1024px) {
    .audio-player-container {
        width: 360px;
        padding: 24px 20px;
    }

    .episode-info h3 {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .map-header {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .project-selector {
        order: 1;
    }

    .project-dropdown-btn {
        font-size: 16px;
    }

    /* Show hamburger menu button */
    .mobile-menu-toggle {
        display: block;
        margin-left: auto;
        order: 2;
    }

    /* Hide nav links by default on mobile */
    .header-controls {
        display: none;
        order: 3;
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .header-controls.show {
        display: flex;
    }

    .nav-link {
        font-size: 14px;
        padding: 10px 16px;
        width: 100%;
        text-align: center;
    }

    /* Mobile controls container */
    .mobile-controls {
        order: 4;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .episode-dropdown,
    .topic-dropdown {
        width: 100%;
        font-size: 13px;
    }

    .cluster-control {
        width: 100%;
    }

    .controls-hint {
        display: none;
    }

    .audio-player-container {
        width: 100%;
        top: auto;
        bottom: 0;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 32px;
        animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

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

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
