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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

/* Dark mode styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .map {
    border-color: #444;
    background-color: #2d2d2d;
}

body.dark-mode .controls {
    background-color: #2d2d2d;
    border-color: #444;
}

body.dark-mode .status.info {
    background-color: #1e3a8a;
    color: #93c5fd;
    border-color: #3b82f6;
}

body.dark-mode .status.success {
    background-color: #166534;
    color: #86efac;
    border-color: #22c55e;
}

body.dark-mode .status.error {
    background-color: #991b1b;
    color: #fca5a5;
    border-color: #ef4444;
}

body.dark-mode .input-group input {
    background-color: #374151;
    border-color: #4b5563;
    color: #e0e0e0;
}

body.dark-mode .input-group input:focus {
    border-color: #3b82f6;
}

body.dark-mode .input-group label {
    color: #d1d5db;
}

body.dark-mode .share-url {
    background-color: #374151;
    border-color: #4b5563;
    color: #e0e0e0;
}

body.dark-mode .location-info {
    background-color: #374151;
    border-color: #4b5563;
}

body.dark-mode .location-info h3 {
    color: #f3f4f6;
}


body.dark-mode .header p {
    color: #d1d5db;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.dark-mode-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: 2px solid #ddd;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

body.dark-mode .dark-mode-toggle {
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .dark-mode-toggle:hover {
    background-color: #444;
}

.header .logo {
    height: 75px;
    width: 150px;
    margin-bottom: 10px;
    object-fit: contain;
}

.header p {
    font-size: 1.1rem;
    color: #666;
}

.main-content {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.map-container {
    flex: 1;
    min-height: 500px;
}

.map {
    width: 100%;
    height: 500px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.controls {
    flex: 0 0 350px;
    height: 500px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.section {
    margin-bottom: 12px;
}

.section:last-child {
    margin-bottom: 0;
}

.status {
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 0.9rem;
}

.status.info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.status.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.status.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 6px;
}

.btn:last-child {
    margin-bottom: 0;
}

.btn {
    background-color: #2196f3;
    color: white;
}

.btn:hover {
    background-color: #1976d2;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-navigation {
    background-color: #28a745;
    color: white;
}

.btn-navigation:hover {
    background-color: #218838;
}

.input-group {
    margin-bottom: 10px;
}

.input-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: #2196f3;
}

.coordinate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.share-url {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.9rem;
    margin-top: 10px;
}

.location-info {
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

.location-info h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.location-info p {
    margin-bottom: 5px;
}

.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .controls {
        flex: none;
        height: auto;
        min-height: 400px;
    }
    
    .map {
        height: 400px;
    }
}

/* Leaflet map styling */
.leaflet-container {
    height: 100%;
    border-radius: 6px;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        margin-bottom: 20px;
    }
    
    .header .logo {
        height: 56px;
        width: 112px;
    }
    
    .dark-mode-toggle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .controls {
        max-height: 70vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .map {
        height: 350px;
        min-height: 350px;
    }
    
    .map-container {
        min-height: 350px;
    }
    
    /* Improve touch targets on mobile */
    .btn {
        padding: 12px;
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .input-group input {
        padding: 12px;
        font-size: 1rem;
    }
    
    /* Prevent zoom on input focus on iOS */
    .input-group input {
        font-size: 16px;
    }
}

/* Prevent body scroll when interacting with map on mobile */
.leaflet-container {
    touch-action: pan-x pan-y;
}

/* Improve scrollbar styling for controls */
.controls::-webkit-scrollbar {
    width: 6px;
}

.controls::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.controls::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.controls::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

body.dark-mode .controls::-webkit-scrollbar-track {
    background: #2d2d2d;
}

body.dark-mode .controls::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-mode .controls::-webkit-scrollbar-thumb:hover {
    background: #666;
}
