/* Base Variables */
:root {
    --primary-color: #00A650;
    --secondary-color: #008C44;
    --text-color: #333;
    --bg-color: #fff;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --panel-bg: rgba(255, 255, 255, 0.95);
    --panel-border: rgba(0, 0, 0, 0.1);
    --modal-bg: #fff;
    --tools-bg: rgba(255, 255, 255, 0.95);
    
    /* Apple-specific colors */
    --apple-blue: #007AFF;
    --apple-gray: #F5F5F7;
    --apple-text: #1D1D1F;
    --apple-shadow: rgba(0, 0, 0, 0.1);
}

/* Dark Theme */
[data-theme="dark"] {
    --text-color: #fff;
    --bg-color: #1a1a1a;
    --nav-bg: rgba(26, 26, 26, 0.95);
    --panel-bg: rgba(40, 40, 40, 0.95);
    --panel-border: rgba(255, 255, 255, 0.1);
    --modal-bg: #2a2a2a;
    --tools-bg: rgba(40, 40, 40, 0.95);
    
    /* Apple dark theme colors */
    --apple-blue: #0A84FF;
    --apple-gray: #2C2C2E;
    --apple-text: #FFFFFF;
    --apple-shadow: rgba(0, 0, 0, 0.2);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Map Container */
#map {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 30px;
    z-index: 1;
    transition: margin-left 0.3s ease;
}

/* Control Button Styles - Apple Maps inspired */
.control-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--apple-gray);
    border: none;
    border-radius: 18px;
    color: var(--apple-text);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px var(--apple-shadow);
    position: relative;
    overflow: hidden;
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--apple-shadow);
    background: var(--apple-blue);
    color: white;
}

.control-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px var(--apple-shadow);
}

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

.control-btn .icon {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.control-btn:hover .icon {
    transform: scale(1.1);
}

/* Button Group Styles */
.nav-content .flex.items-center.gap-4 {
    display: flex;
    gap: 8px;
    padding: 4px;
    background: var(--apple-gray);
    border-radius: 20px;
    box-shadow: 0 2px 8px var(--apple-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Input Styles */
input {
    padding: 8px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Leaflet Custom Styles */
.leaflet-control-layers,
.leaflet-control-zoom,
.leaflet-control-locate,
.leaflet-control-polylinemeasure,
.leaflet-control-fullscreen {
    background: var(--apple-gray) !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 2px 8px var(--apple-shadow) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    margin: 10px !important;
    overflow: hidden !important;
}

.leaflet-control-layers-toggle,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out,
.leaflet-control-locate a,
.leaflet-control-polylinemeasure a,
.leaflet-control-fullscreen a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    background-color: transparent !important;
    color: var(--apple-text) !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-layers-toggle:hover,
.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover,
.leaflet-control-locate a:hover,
.leaflet-control-polylinemeasure a:hover,
.leaflet-control-fullscreen a:hover {
    background-color: var(--apple-blue) !important;
    color: white !important;
}

/* Utility Classes */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-4 {
    gap: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .footer-content {
        font-size: 10px;
        padding: 0 10px;
    }

    .coord-input input {
        width: 120px;
    }

    .nav-content {
        padding: 0 10px;
    }
    
    .control-btn {
        width: 32px;
        height: 32px;
    }
}