* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: white;
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #2d2d2d;
    border-bottom: 2px solid #444;
}

.speed-display {
    text-align: center;
}

#speed {
    font-size: 2.5em;
    font-weight: bold;
    color: #4CAF50;
}

.speed-unit {
    font-size: 0.9em;
    color: #ccc;
}

.user-btn {
    background: #007AFF;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Map */
.map-container {
    flex: 1;
    background: #333;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 15px;
    background: #2d2d2d;
    border-top: 2px solid #444;
}

.control-btn {
    padding: 15px 10px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn:active {
    transform: scale(0.95);
}

.large-btn {
    min-height: 60px;
    font-size: 1.3em;
}

.control-btn:not(:disabled) {
    background: #007AFF;
    color: white;
}

.control-btn:disabled {
    background: #666;
    color: #999;
    cursor: not-allowed;
}

.control-btn.secondary:not(:disabled) {
    background: #FF9500;
}

.control-btn.success:not(:disabled) {
    background: #4CAF50;
}

.control-btn.danger:not(:disabled) {
    background: #FF3B30;
}

/* Saved Tracks */
.saved-tracks {
    display: flex;
    gap: 10px;
    padding: 0 15px 15px;
    background: #2d2d2d;
}

.tracks-dropdown {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #333;
    color: white;
    font-size: 1.1em;
}

.tracks-dropdown:disabled {
    background: #666;
    color: #999;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2d2d2d;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
}

.modal h3 {
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.modal input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: none;
    border-radius: 12px;
    background: #333;
    color: white;
    font-size: 1.1em;
}

.modal input::placeholder {
    color: #999;
}

.modal a {
    color: #007AFF;
    text-decoration: none;
}

.modal p {
    text-align: center;
    margin-top: 15px;
}

/* Leaflet Map Overrides */
.leaflet-container {
    background: #1a1a1a;
}

.leaflet-control-zoom a {
    background: #333 !important;
    color: white !important;
    border: none !important;
}

.leaflet-popup-content {
    color: #333;
}