:root {
    --color-bg: #1a1a2e;
    --color-bg-light: #16213e;
    --color-surface: rgba(255, 255, 255, 0.06);
    --color-surface-hover: rgba(255, 255, 255, 0.1);
    --color-primary: #4A7C59;
    --color-primary-dark: #3a6246;
    --color-accent: #C4944A;
    --color-text: #f0f0f0;
    --color-text-muted: #a0a0a0;
    --color-danger: #e74c3c;
    --color-success: #2ecc71;
    --color-border: rgba(255, 255, 255, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

#app-container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

#screen-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding-bottom: calc(80px + var(--safe-bottom));
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Glass Tab Bar */
.glass-bar {
    position: absolute;
    bottom: calc(16px + var(--safe-bottom));
    left: 16px;
    right: 16px;
    height: 64px;
    background: rgba(26, 26, 46, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-full);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.tab-item {
    color: var(--color-text-muted);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.tab-item.active {
    color: var(--color-primary);
}

.add-tab-wrapper {
    position: relative;
    top: -20px;
}

.add-button {
    width: 56px;
    height: 56px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.4);
    transition: transform 0.2s ease;
}

.add-button:active {
    transform: scale(0.95);
}

/* Glass Card */
.glass-card {
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
}

/* Typography */
h1 { font-size: 24px; font-weight: 700; margin-bottom: 16px; }
h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
p { font-size: 14px; line-height: 1.5; color: var(--color-text-muted); }

/* Forms */
input, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: white;
    font-size: 16px;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, textarea:focus {
    border-color: var(--color-primary);
}

.btn {
    background: var(--color-surface);
    color: white;
    border: 1px solid var(--color-border);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:active { background: var(--color-primary-dark); }
.btn:active { background: var(--color-surface-hover); transform: scale(0.98); }

/* Bottom Sheet */
.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: var(--color-bg-light);
    border-radius: 24px 24px 0 0;
    padding: 24px 16px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    max-height: 85vh;
    overflow-y: auto;
    padding-bottom: calc(24px + var(--safe-bottom));
}

.bottom-sheet.open {
    bottom: 0;
}

.sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.drag-handle {
    width: 40px;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin: 0 auto 20px auto;
}

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* Stars */
.star {
    color: var(--color-border);
    cursor: pointer;
}
.star.filled {
    color: var(--color-accent);
    fill: var(--color-accent);
}

/* Toast */
#toast-container {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }

/* Leaflet Overrides */
.leaflet-container {
    background: var(--color-bg) !important;
    font-family: inherit !important;
}
.leaflet-control-attribution {
    display: none;
}
.leaflet-control-zoom {
    display: none;
}
.custom-marker {
    background: var(--color-primary);
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 10px;
}
