﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #6b7280;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.app-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    height: calc(100vh - 60px);
}

/* Sidebar Styles */
.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 24px;
    box-shadow: var(--shadow);
}

.sidebar-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

    .sidebar-header h1 {
        font-size: 24px;
        font-weight: 700;
        margin-bottom: 8px;
        background: linear-gradient(135deg, var(--primary), #8b5cf6);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.tool-section {
    margin-bottom: 32px;
}

    .tool-section h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 16px;
        color: var(--text);
    }

.tool-sectionlist {
    position: fixed;
    top: 50px;
    right: 20px;
    background: #ffffffcc; /* semi-transparent white for modern look */
    backdrop-filter: blur(10px); /* glassmorphism effect */
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

    /* Optional: hover effect */
    .tool-sectionlist:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }
    .tool-sectionlist h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 16px;
        color: var(--text);
    }

.tool-sectionDownload {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffffffcc; /* semi-transparent white for modern look */
    backdrop-filter: blur(10px); /* glassmorphism effect */
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

    /* Optional: hover effect */
    .tool-sectionDownload:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
    }

    .tool-sectionDownload h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 16px;
        color: var(--text);
    }
/* Compact Icon Grid */
.icon-grid.compact {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.icon-btn.compact {
    padding: 8px;
    min-height: 50px;
    flex-direction: column;
    aspect-ratio: 1;
}

    .icon-btn.compact .icon {
        font-size: 18px;
        margin-bottom: 4px;
    }

    .icon-btn.compact .category-name {
        display: none;
    }

    .icon-btn.compact:hover .category-name {
        display: block;
        position: absolute;
        bottom: -25px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--text);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 11px;
        white-space: nowrap;
        z-index: 10;
    }

    .icon-btn.compact:hover::after {
        content: '';
        position: absolute;
        bottom: -8px;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid var(--text);
    }

/* Search Box */
.search-box {
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--surface);
    transition: all 0.2s ease;
}

    .search-input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .search-input::placeholder {
        color: var(--text-light);
    }

/* No Results */
.no-results {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-style: italic;
}

/* Scrollbar Styling for Icon Grid */
.icon-grid.compact::-webkit-scrollbar {
    width: 6px;
}

.icon-grid.compact::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 3px;
}

.icon-grid.compact::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 3px;
}

    .icon-grid.compact::-webkit-scrollbar-thumb:hover {
        background: var(--text-light);
    }

/* Original icon grid for reference */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    position: relative;
}

    .icon-btn:hover {
        border-color: var(--primary);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }

    .icon-btn.selected {
        border-color: var(--primary);
        background: var(--primary);
        color: white;
    }

    .icon-btn .icon {
        font-size: 24px;
        margin-bottom: 8px;
    }

.category-name {
    font-weight: 500;
    font-size: 12px;
    text-align: center;
}
/* POI List */
.poi-list {
    max-height: 300px;
    overflow-y: auto;
}

.poi-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .poi-item:hover {
        border-color: var(--primary);
        transform: translateX(4px);
    }

.poi-icon {
    font-size: 20px;
    margin-right: 12px;
}

.poi-info {
    flex: 1;
}

    .poi-info strong {
        display: block;
        font-size: 14px;
    }

    .poi-info small {
        color: var(--text-light);
        font-size: 12px;
    }

/* Map Container */
.map-container {
    position: relative;
}

.map {
    height: 100%;
    width: 100%;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .btn-primary:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: var(--shadow);
    }

    .btn-primary:disabled {
        background: var(--secondary);
        cursor: not-allowed;
        transform: none;
    }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    margin-bottom: 8px;
}

    .btn-secondary:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
}

    .btn-outline:hover {
        background: var(--primary);
        color: white;
    }

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn-sm {
    padding: 2px 6px;
    font-size: 12px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

    .modal-header h2 {
        font-size: 20px;
        font-weight: 600;
    }

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid var(--border);
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--background);
    border-radius: var(--radius);
}

    .form-section h4 {
        margin-bottom: 16px;
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
    }

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s ease;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
}

/* Custom Properties */
.custom-property {
    display: grid;
    grid-template-columns: 1fr 1fr 100px 40px;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.export-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* Leaflet Customizations */
.custom-poi-marker {
    background: none !important;
    border: none !important;
}

.poi-popup {
    min-width: 200px;
}

    .poi-popup h3 {
        margin-bottom: 8px;
        color: var(--text);
    }

    .poi-popup p {
        margin-bottom: 4px;
        color: var(--text-light);
    }

.custom-props {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* Loading Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: var(--text);
    font-weight: 500;
}

/* Category Group Headers */
.category-group {
    margin-bottom: 16px;
}

.category-group-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: var(--background);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .category-group-header::before {
        content: '';
        width: 4px;
        height: 4px;
        background: var(--primary);
        border-radius: 50%;
    }

/* Ultra Compact Grid for many icons */
.icon-grid.compact {
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    max-height: 400px;
    padding: 2px;
}

.icon-btn.compact {
    padding: 4px;
    min-height: 40px;
    aspect-ratio: 1;
    border-width: 1px;
}

    .icon-btn.compact .icon {
        font-size: 14px;
        margin-bottom: 0;
    }

/* Search enhancements */
.search-box {
    position: sticky;
    top: 0;
    background: var(--surface);
    padding: 8px 0;
    z-index: 10;
    margin-bottom: 8px;
}

/* Selected state improvements */
.icon-btn.compact.selected {
    transform: scale(1.1);
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Scrollbar improvements */
.icon-grid.compact {
    scrollbar-width: thin;
    scrollbar-color: var(--secondary) var(--border);
}

/* Floating POI List */
.map-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-poi-list {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
}

.floating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

    .floating-header h3 {
        margin: 0;
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
        display: flex;
        align-items: center;
        gap: 8px;
    }

.poi-stats {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poi-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.btn-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
}

    .btn-toggle:hover {
        background: var(--background);
        color: var(--text);
    }

.floating-content {
    max-height: 400px;
    overflow-y: auto;
}

/* POI List Items in Floating Panel */
.poi-list {
    padding: 8px;
}

.poi-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 12px;
}

    .poi-item:hover {
        border-color: var(--primary);
        transform: translateX(2px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .poi-item.hovered {
        border-color: var(--primary);
        background: var(--primary);
        color: white;
    }

        .poi-item.hovered .poi-info strong,
        .poi-item.hovered .poi-info small {
            color: white;
        }

.poi-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.poi-info {
    flex: 1;
    min-width: 0;
}

    .poi-info strong {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: var(--text);
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .poi-info small {
        color: var(--text-light);
        font-size: 11px;
    }

/* Empty State in Floating Panel */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
}

    .empty-state .empty-icon {
        font-size: 32px;
        margin-bottom: 12px;
        opacity: 0.5;
    }

    .empty-state p {
        margin: 0;
        font-size: 13px;
    }

/* Scrollbar for Floating Content */
.floating-content::-webkit-scrollbar {
    width: 4px;
}

.floating-content::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 2px;
}

.floating-content::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 2px;
}

    .floating-content::-webkit-scrollbar-thumb:hover {
        background: var(--text-light);
    }

/* Compact mode when collapsed */
.floating-poi-list.compact {
    width: 200px;
}

    .floating-poi-list.compact .floating-header {
        padding: 12px;
    }

    .floating-poi-list.compact h3 {
        font-size: 13px;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .floating-poi-list {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* Animation for smooth expand/collapse */
.floating-content {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
