/* Mappie - Mobile-Friendly Styles */

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

:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --accent-color: #FF5733;
    --bg-color: #ffffff;
    --text-color: #333333;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    --header-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    touch-action: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    height: var(--header-height);
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: var(--shadow);
    z-index: 1000;
    flex-shrink: 0;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Map Container */
#map {
    flex: 1;
    width: 100%;
    position: relative;
    touch-action: pan-x pan-y;
}

/* Controls */
#controls {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-btn {
    width: 50px;
    height: 50px;
    background: var(--bg-color);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    transform: scale(0.95);
    background: #f5f5f5;
}

.control-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

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

.control-btn.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* MapLibre GL Controls Override for Mobile */
.maplibregl-ctrl-group {
    background: var(--bg-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.maplibregl-ctrl-group button {
    width: 40px;
    height: 40px;
}

.maplibregl-ctrl-bottom-left {
    bottom: 100px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    header h1 {
        font-size: 20px;
    }

    .control-btn {
        width: 45px;
        height: 45px;
    }

    .maplibregl-ctrl-group button {
        width: 36px;
        height: 36px;
    }
}

/* Prevent text selection on mobile */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    header {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-top: env(safe-area-inset-top);
    }

    #controls {
        right: max(20px, env(safe-area-inset-right));
        bottom: max(30px, env(safe-area-inset-bottom));
    }

    .maplibregl-ctrl-bottom-left {
        bottom: max(100px, calc(80px + env(safe-area-inset-bottom)));
        left: max(10px, env(safe-area-inset-left));
    }
}
