:root {
    --primary-color: #ff3b30; /* Systems Red */
    --primary-hover: #d6332a;
    --secondary-color: #34c759; /* Systems Green */
    --secondary-hover: #2db34e;
    --bg-glass: rgba(20, 20, 20, 0.7);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --font-family: 'Inter', sans-serif;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    background-color: #111;
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none; /* Let clicks pass through to map */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
}

/* Header */
.app-header {
    pointer-events: auto;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

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

.logo .icon {
    font-size: 24px;
}

.logo h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.status-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #fbbf24; /* Amber for connecting */
}

.status-indicator.connected .dot {
    background-color: var(--secondary-color);
    box-shadow: 0 0 8px rgba(52, 199, 89, 0.5);
}

.status-indicator.connected .text {
    color: var(--secondary-color);
}

/* Controls */
.controls-container {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 24px;
}

.btn {
    border: none;
    outline: none;
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-glass);
    color: white;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(40, 40, 40, 0.8);
}

/* Toast */
#toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    z-index: 100;
    width: 90%;
    max-width: 400px;
}

.toast {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-glass);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    text-align: center;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

.user-marker-pulse {
    width: 20px;
    height: 20px;
    background: rgba(52, 120, 246, 0.4);
    border-radius: 50%;
    position: absolute;
    top: -5px;
    left: -5px;
    animation: pulse 2s infinite;
}

@media (min-width: 600px) {
    .controls-container {
        flex-direction: row;
        width: auto;
    }
    
    .app-header {
        margin: 0;
        width: auto;
        min-width: 300px;
    }

    .ui-overlay {
        align-items: center; /* Center header */
    }
}
