/* HushMap - Quiet Workspace Finder */

:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f26;
    --bg-tertiary: #252c35;
    --bg-card: #1e2530;
    --text-primary: #ffffff;
    --text-secondary: #8b98a5;
    --text-muted: #6e7c8a;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --quiet-green: #22c55e;
    --moderate-yellow: #eab308;
    --loud-red: #ef4444;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg-primary);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 28px;
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.btn-report {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-report:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.btn-report .plus {
    font-size: 18px;
    font-weight: 500;
}

/* Search */
.search-container {
    padding: 16px 20px;
    background: var(--bg-secondary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    border: 1px solid var(--border);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-chips {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.chip:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Map Container */
.map-container {
    height: 280px;
    background: linear-gradient(135deg, #1a2234 0%, #0d1421 100%);
    position: relative;
    overflow: hidden;
}

.map-overlay {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
}

.map-legend {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.quiet { background: var(--quiet-green); }
.dot.moderate { background: var(--moderate-yellow); }
.dot.loud { background: var(--loud-red); }

.map-pins {
    position: absolute;
    inset: 0;
    /* Fake map grid lines */
    background-image: 
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

.map-pin {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.2s;
    border: 2px solid rgba(255,255,255,0.2);
    animation: pulse 2s infinite;
}

.map-pin:hover {
    transform: translate(-50%, -50%) scale(1.15);
    z-index: 10;
}

.map-pin.quiet {
    background: rgba(34, 197, 94, 0.9);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.map-pin.moderate {
    background: rgba(234, 179, 8, 0.9);
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
}

.map-pin.loud {
    background: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.5); }
}

.map-pin.quiet { animation-name: pulse-green; }
@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 15px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 0 25px rgba(34, 197, 94, 0.5); }
}

/* Cards Section */
.cards-section {
    padding: 20px;
    padding-bottom: 100px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.live-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--quiet-green);
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cards-scroll {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.location-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.location-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.card-type {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.noise-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
}

.noise-badge.quiet {
    background: rgba(34, 197, 94, 0.15);
    color: var(--quiet-green);
}

.noise-badge.moderate {
    background: rgba(234, 179, 8, 0.15);
    color: var(--moderate-yellow);
}

.noise-badge.loud {
    background: rgba(239, 68, 68, 0.15);
    color: var(--loud-red);
}

.card-amenities {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.amenity {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.report-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    justify-content: space-around;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 12px 0 20px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--accent);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 430px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px;
}

.current-location {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.current-location svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.current-location span {
    font-size: 14px;
    color: var(--text-secondary);
}

.noise-levels {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.noise-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.noise-btn:hover {
    border-color: var(--accent);
}

.noise-btn.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.noise-emoji {
    font-size: 24px;
}

.noise-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.report-extras {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover:not(:disabled) {
    background: var(--accent-light);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Detail Modal */
.modal-large {
    max-height: 85vh;
    overflow-y: auto;
}

.detail-noise-current {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.current-noise-display {
    display: flex;
    align-items: center;
    gap: 12px;
}

.noise-emoji-large {
    font-size: 48px;
}

.noise-level-text {
    font-size: 20px;
    font-weight: 600;
    display: block;
}

.noise-updated {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-stats {
    display: flex;
    gap: 20px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.noise-chart {
    margin-bottom: 24px;
}

.noise-chart h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.chart-container {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 80px;
    padding: 8px 0;
}

.chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
}

.chart-bar.quiet { background: var(--quiet-green); }
.chart-bar.moderate { background: var(--moderate-yellow); }
.chart-bar.loud { background: var(--loud-red); }

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.detail-amenities {
    margin-bottom: 24px;
}

.detail-amenities h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.amenities-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.amenity-item.available {
    color: var(--quiet-green);
}

.amenity-item.unavailable {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.6;
}

.btn-navigate {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-navigate svg {
    width: 20px;
    height: 20px;
}

.btn-navigate:hover {
    background: var(--accent-light);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--quiet-green);
    color: white;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s;
    z-index: 300;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 18px;
}

/* Responsive */
@media (min-width: 431px) {
    body {
        background: #0a0d12;
    }
    
    .app {
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}
