:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-glass: rgba(255, 255, 255, 1);
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --footer-height: 30px;
    --panel-width: 360px;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body,
html {
    height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    background: #f3f4f6;
}

#map {
    height: calc(100% - var(--footer-height));
    width: 100%;
    z-index: 1;
}

/* Control Panel */
.control-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    width: var(--panel-width);
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    z-index: 1000;
    padding: 0;
    transition: transform 0.3s ease-in-out;
    max-height: calc(100% - 60px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.control-panel.hidden {
    transform: translateX(calc(-100% - 20px));
}

.panel-content {
    padding: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #9ca3af;
}

/* Tabs */
.panel-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-top: 10px;
    padding: 0 10px;
}

.tab-btn {
    flex: 1;
    padding: 12px 5px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 15px;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
    padding-top: 15px;
}

.tab-content.active {
    display: block;
}

/* Forms */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: #374151;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    font-size: 1rem;
    color: #111;
}

.input-group input:focus {
    border-color: var(--primary-color);
    ring: 2px solid rgba(37, 99, 235, 0.2);
}

.form-section-Label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

/* Radio Buttons */
.radio-buttons-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.radio-btn-option {
    position: relative;
}

.radio-btn-option input {
    display: none;
}

.radio-btn-option span {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    transition: all 0.2s;
}

.radio-btn-option input:checked+span {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #eff6ff;
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* History */
.history-section {
    margin-top: 25px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-header h3 {
    font-size: 1rem;
    color: #374151;
    font-weight: 600;
}

.history-header button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* History Item Horizontal Layout */
.history-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f9fafb;
}

.history-index {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.history-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.history-data {
    font-family: monospace;
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.history-time {
    font-size: 12px;
    color: #2563eb;
    font-weight: 500;
}

.history-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.history-actions button {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.history-actions button:hover {
    background: #fff;
    border-color: #9ca3af;
    color: #1f2937;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.history-actions .delete:hover {
    color: #dc3545;
    border-color: #dc3545;
    background: #fff5f5;
}

/* Map Controls & Footer */
.panel-toggle-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999;
}

.map-controls-group {
    position: absolute;
    right: 10px;
    bottom: 50px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
}

.map-control-btn {
    background: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 1.2rem;
    color: #666;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.map-control-btn:hover {
    color: var(--primary-color);
}

#main-footer {
    height: var(--footer-height);
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #9ca3af;
    z-index: 2000;
    position: relative;
    padding: 0 20px;
}

.footer-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
}

/* Loader, Modal, Popups... (Keep simplified for brevity, assume they are standard) */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Keep Popup Styles */
.leaflet-popup-content-wrapper {
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    width: 300px !important;
}

.popup-header-design {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.header-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.popup-header-design h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.popup-body-design {
    padding: 15px;
}

.label-text {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
}

.address-text {
    font-size: 14px;
    color: #111;
    margin-bottom: 12px;
    line-height: 1.4;
}

.coords-text {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.pink-icon {
    color: #db2777;
    margin-right: 6px;
}

.radius-control-design {
    background: #f9fafb;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
}

.radius-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.radius-header span {
    font-weight: 600;
    color: #374151;
    font-size: 13px;
}

.radius-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
}

.radius-input-wrapper input {
    width: 60px;
    border: none;
    outline: none;
    text-align: right;
    font-size: 13px;
}

.radius-input-wrapper .unit {
    color: #6b7280;
    font-size: 12px;
    margin-left: 2px;
}

.radius-slider {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    appearance: none;
}

.radius-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #2563eb;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.popup-footer-design {
    display: flex;
    gap: 8px;
    padding: 10px 15px 15px;
}

.btn-design {
    flex: 1;
    border: none;
    border-radius: 6px;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.btn-blue {
    background-color: #3b82f6;
}

.btn-blue:hover {
    background-color: #2563eb;
}

.btn-green {
    background-color: #10b981;
}

.btn-green:hover {
    background-color: #059669;
}

.dot-icon {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

.dot-icon.red {
    background: #d1d5db;
}

/* UTILITY CLASSES FOR NOTIFICATIONS (BOOTSTRAP-LIKE) */
.bg-danger {
    background-color: #dc3545 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.bg-success {
    background-color: #198754 !important;
}

.bg-primary {
    background-color: #0d6efd !important;
}

.bg-dark {
    background-color: #212529 !important;
}

.text-white {
    color: white !important;
}

.text-dark {
    color: #212529 !important;
}

.shadow {
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175) !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.justify-content-center {
    justify-content: center !important;
}

.rounded-3 {
    border-radius: .3rem !important;
}

.w-100 {
    width: 100% !important;
}

.p-2 {
    padding: .5rem !important;
}

.p-3 {
    padding: 1rem !important;
}

.me-2 {
    margin-right: .5rem !important;
}

.me-3 {
    margin-right: 1rem !important;
}

.ms-3 {
    margin-left: 1rem !important;
}

.ms-4 {
    margin-left: 1.5rem !important;
}

.fa-lg {
    font-size: 1.25em !important;
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: .25em .25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: .25rem;
    opacity: .5;
    cursor: pointer;
}

.btn-close:hover {
    opacity: .75;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}