* {
    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: var(--bg-darker);
    justify-content: center;
    align-items: center;
}

.compass-container {
    text-align: center;
}

.compass-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 4px solid var(--border);
    position: relative;
    margin: 0 auto 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: 50% 50%;
    transition: transform 0.3s ease-out;
}

.compass-needle::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 120px solid var(--accent);
}

.compass-needle::after {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 40px solid #666;
}

.compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px var(--accent);
}

.compass-distance {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.compass-spot-name {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* 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;
}
