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

:root {
    --bg-dark: #1a1a1a;
    --bg-darker: #0d0d0d;
    --bg-card: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #00bcd4;
    --accent-hover: #00acc1;
    --border: #3a3a3a;
    --success: #4caf50;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    touch-action: pan-y;
}

#app {
    height: 100vh;
    position: relative;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.view.active {
    display: flex;
}

/* List View */
#list-view header {
    background: var(--bg-darker);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

#list-view h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.gps-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.gps-status.active {
    color: var(--success);
}

#spots-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 5rem;
}

#spots-list {
    list-style: none;
}

.spot-item {
    background: var(--bg-card);
    margin: 0.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}

.spot-item.swiping {
    transition: none;
}

.spot-item:active {
    background: #333;
}

.spot-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.spot-details {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.spot-distance::before {
    content: '📍 ';
}

.spot-bearing::before {
    content: '🧭 ';
}

.add-spot-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 188, 212, 0.3);
    transition: background 0.2s, transform 0.1s;
}

.add-spot-btn:active {
    transform: translateX(-50%) scale(0.95);
    background: var(--accent-hover);
}

/* Map View */
#map {
    width: 100%;
    height: 100%;
}

.leaflet-container {
    background: var(--bg-darker);
}

/* ── Compass View ─────────────────────────────────────── */
#compass-view {
    background: radial-gradient(ellipse at 50% 40%, #1a1a2e 0%, #0a0a12 100%);
    justify-content: center;
    align-items: center;
}

.compass-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Outer brass bezel */
.compass-bezel {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    position: relative;
    margin: 0 auto 1rem;
    padding: 14px;

    /* Layered brass/bronze radial gradient */
    background:
        radial-gradient(circle at 32% 28%, #d4a843 0%, #a07828 30%, #5a3e10 60%, #7a5820 80%, #c49030 100%);

    /* 3-D depth: outer shadow + inner highlight ring */
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.85),
        0 4px 10px rgba(0, 0, 0, 0.6),
        inset 0 3px 6px rgba(255, 235, 160, 0.25),
        inset 0 -3px 8px rgba(0, 0, 0, 0.7);

    /* Subtle forward tilt for 3-D look */
    transform: perspective(900px) rotateX(6deg);
}

/* Notched degree ring around bezel */
.compass-bezel::before {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 210, 100, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Inner compass face */
.compass-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: #0c0c18;

    box-shadow:
        inset 0 6px 18px rgba(0, 0, 0, 0.9),
        inset 0 -3px 6px rgba(255, 255, 255, 0.03);
}

/* SVG tick/label layer */
.compass-face-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Glass dome highlight */
.compass-glass {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 38% 28%, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.04) 40%, transparent 70%);
    pointer-events: none;
    z-index: 20;
}

/* ── Needle ───────────────────────────────────────────── */
.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 220px;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    transition: transform 0.3s ease-out;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
}

.compass-needle svg {
    width: 100%;
    height: 100%;
}

/* Brass pivot cap */
.compass-center-cap {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 38% 32%, #f0d070, #b07820 55%, #6a4810);
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.8),
        0 0 8px rgba(180, 130, 30, 0.4);
    z-index: 15;
}

/* ── Info below compass ───────────────────────────────── */
.compass-bearing {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
    min-height: 1.4rem;
}

.compass-distance {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 0.4rem;
    text-shadow: 0 0 16px rgba(0, 188, 212, 0.5);
}

.compass-spot-name {
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Permission overlay */
.permission-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.permission-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.permission-content h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.permission-content p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.permission-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.permission-btn:active {
    background: var(--accent-hover);
}

/* Delete button on swipe */
.spot-item .delete-btn {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: #f44336;
    color: white;
    border: none;
    padding: 0 1.5rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}

.spot-item.show-delete .delete-btn {
    opacity: 1;
}
