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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

/* Control Panel */
.control-panel {
    width: 360px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 1000;
}

.panel-header {
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.panel-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.control-section {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.control-section h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 12px;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 8px;
}

#searchInput {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.address-info {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    display: none;
}

.address-info.active {
    display: block;
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-tool {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-tool:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.btn-tool.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tool-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Radius Controls */
.radius-controls {
    display: flex;
    gap: 8px;
}

#radiusInput {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

#radiusUnit {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Export/Import Sections */
.export-section,
.import-section {
    margin-top: 12px;
}

.coordinate-group {
    margin-bottom: 16px;
}

.coordinate-group:last-child {
    margin-bottom: 0;
}

.coordinate-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.coordinate-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    background: #f9fafb;
}

.coordinate-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

#importInput {
    background: white;
}

.export-controls,
.import-controls {
    margin-bottom: 12px;
}

.export-controls .btn,
.import-controls .btn {
    width: 100%;
}

/* Share Section */
.share-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-controls .btn-primary {
    width: 100%;
}

#shareLinkSection {
    display: flex;
    gap: 8px;
}

#shareLink {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    background: #f9fafb;
}

#copyLinkBtn {
    white-space: nowrap;
}

/* Map Container */
#map {
    flex: 1;
    height: 100vh;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 4px;
}

.leaflet-popup-content {
    margin: 12px;
    font-size: 13px;
}

/* Scrollbar Styling */
.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .control-panel {
        width: 100%;
        height: 40vh;
        max-height: 400px;
    }

    #map {
        height: 60vh;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error Messages */
.message {
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 13px;
}

.message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
