:root {
    --primary: #4285F4; /* Google Blue */
    --primary-hover: #357ae8;
    --bg-light: #f8f9fa;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-main: #202124;
    --text-muted: #5f6368;
    --start-color: #34A853; /* Google Green */
    --goal-color: #EA4335;  /* Google Red */
    --secondary: #5f6368;
}

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

body, html {
    width: 100%;
    height: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    overflow: hidden;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Glassmorphism Panel */
.glass-panel {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 1000;
    width: 380px;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary);
    margin-bottom: 4px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 24px;
}

/* Mode Toggle */
.input-group label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.toggle-container {
    display: flex;
    background: rgba(0, 0, 0, 0.05); /* Changed from white to light grey for visibility */
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.input-field {
    width: 100%;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-main);
    font-family: inherit;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
}

/* Status Box */
.status-box {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.point-status {
    display: flex;
    align-items: center;
}

.point-status:first-child {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 16px;
    box-shadow: 0 0 10px currentColor;
}

.start-dot { color: var(--start-color); background: var(--start-color); }
.goal-dot { color: var(--goal-color); background: var(--goal-color); }

.coords {
    display: flex;
    flex-direction: column;
}

.coords .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.coords .value {
    font-size: 14px;
    font-weight: 600;
    font-family: monospace;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.6);
}

.btn-primary:disabled {
    background: #e8eaed;
    color: #9aa0a6;
    cursor: not-allowed;
    box-shadow: none;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-secondary {
    background: white;
    border: 1px solid #dadce0;
    color: var(--text-main);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover:not(:disabled) {
    background: #f1f3f4;
}

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

#map-controls {
    position: absolute;
    bottom: 24px;
    left: 24px;
    z-index: 1000;
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.1);
    min-width: 200px;
}

.map-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    text-transform: uppercase;
    transition: all 0.2s;
    white-space: nowrap;
}

.map-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.3);
}

.map-btn:hover:not(.active) {
    background: rgba(0,0,0,0.05);
    color: var(--text-main);
}

/* Loader */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .loader { display: block; }

/* Messages */
.error-msg {
    color: #f87171;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    display: none;
}

.success-msg {
    color: #34d399;
    font-size: 13px;
    margin-top: 12px;
    text-align: center;
    display: none;
}

/* Leaflet Theme Overrides */
.leaflet-container {
    background: #e5e3df;
}
.leaflet-bar a {
    background-color: white !important;
    color: #444 !important;
    border-color: #ccc !important;
}
.leaflet-bar a:hover {
    background-color: #f4f4f4 !important;
}
