 * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            height: 100vh;
            overflow: hidden;
        }

        .app-container {
            display: flex;
            height: 100vh;
        }

        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            
        }

        .header {
            height: 70px;
            background: rgba(255, 255, 255, 0.95);
             border-bottom: 1px solid rgba(255, 255, 255, 0.2);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            gap: 15px;
            z-index: 1000;
        }


        .sidebar-toggle {
            display:none;
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: background-color 0.2s;
        }

        .sidebar-toggle:hover {
            background-color: #f3f4f6;
            color:#000000
        }

        .header h1 {
            font-size: 18px;
            font-weight: 600;
            color: #1f2937;
        }

        .status-badges {
            display: flex;
            gap: 8px;
            margin-left: auto;
        }

        .badge {
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
        }

        .badge-success {
            background-color: #dcfce7;
            color: #166534;
        }

        .badge-secondary {
            background-color: #f1f5f9;
            color: #475569;
        }

        .header-logo {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    flex-shrink: 0;
}

.header-logo img {
    height: 50px !important;
    width: auto !important;
    border-radius: 8px !important;
}

.header-logo span {
    font-size: 18px !important;
    font-weight: bold !important;
    color: #10b981 !important;
    white-space: nowrap;
}

        /* CRITICAL: Ensure map container has proper height */
        #map {
            flex: 1;
            position: relative;
            height: calc(100vh - 60px);
            width: 100%;
        }

        .sidebar {
            width: 300px;
            background: white;
            border-left: 1px solid #e5e7eb;
            display: flex;
            flex-direction: column;
            transition: transform 0.3s ease;
            z-index: 999;
        }

        .sidebar.collapsed {
            transform: translateX(100%);
        }

        .sidebar-header {
        border-bottom: 1px solid #e5e7eb;
            background: rgba(255, 255, 255, 0.95);
         color: white;
         padding: 20px;
         text-align: center;
        }

        .sidebar-header h2 {
            font-size: 16px;
            font-weight: 600;
            color: #000000;
            display: flex;
            text-align: center;
            align-items: center;
            gap: 8px;
        }

        .sidebar-content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            align-items: center;
            justify-content: center;

        }

        .sidebar-section {
            margin-bottom: 24px;
        }

        .sidebar-section h3 {
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .status-card {
            background: #f9fafb;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 16px;
        }

        .status-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .status-label {
            font-size: 14px;
            color: #6b7280;
        }

        .form-group {
            margin-bottom: 16px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 500;
            color: #374151;
            margin-bottom: 6px;
        }

        .form-select {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 14px;
            background: white;
            transition: border-color 0.2s;
        }

        .form-select:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .form-select:disabled {
            background-color: #f9fafb;
            color: #9ca3af;
            cursor: not-allowed;
        }

        .btn {
            padding: 10px 16px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 8px;
            justify-content: center;
            width: 100%;
            margin-bottom: 8px;
        }

        .btn-primary {
            background-color: #064e3b;
            color: white;
        }

        .btn-primary:hover:not(:disabled) {
            background-color: #064e3b;
        }

        .btn-secondary {
            background-color: #f1f5f9;
            color: #475569;
        }

        .btn-secondary:hover:not(:disabled) {
            background-color: #e2e8f0;
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .info-card {
            background: #eff6ff;
            border: 1px solid #bfdbfe;
            border-radius: 8px;
            padding: 16px;
        }

        .info-card h4 {
            font-size: 14px;
            font-weight: 600;
            color: #1e40af;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .info-card p {
            font-size: 12px;
            color: #1e40af;
            line-height: 1.4;
        }

        .help-text {
            font-size: 12px;
            color: #6b7280;
            margin-top: 8px;
            line-height: 1.4;
        }

        .sidebar-footer {
            padding: 20px;
            border-top: 1px solid #e5e7eb;
            font-size: 12px;
            color: #6b7280;
        }

        /* File upload styles */
        .file-upload {
            position: relative;
            display: inline-block;
            width: 100%;
        }

        .file-upload input[type=file] {
            position: absolute;
            left: -9999px;
        }

        .file-upload-label {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 10px 16px;
            border: 2px dashed #d1d5db;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 14px;
            color: #6b7280;
        }

        .file-upload-label:hover {
            border-color: #3b82f6;
            color: #3b82f6;
        }

        /* Notification styles */
        .notification {
            position: fixed;
            top: 80px;
            right: 20px;
            background: white;
            border: 1px solid #e5e7eb;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            z-index: 10000;
            max-width: 400px;
            transform: translateX(100%);
            transition: transform 0.3s ease;
        }

        .notification.show {
            transform: translateX(0);
        }

        .notification.success {
            border-left: 4px solid #10b981;
        }

        .notification.warning {
            border-left: 4px solid #f59e0b;
        }

        .notification.error {
            border-left: 4px solid #ef4444;
        }

        .notification-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .notification-title {
            font-weight: 600;
            font-size: 14px;
        }

        .notification-description {
            font-size: 12px;
            color: #6b7280;
            line-height: 1.4;
        }

        .notification-close {
            position: absolute;
            top: 8px;
            right: 8px;
            background: none;
            border: none;
            font-size: 16px;
            cursor: pointer;
            color: #9ca3af;
        }

        /* Legend styles */
        #prelegend {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background: white;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 8px;
            z-index: 1000;
            max-width: 300px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            display: none;
        }

        .legend-content {
            max-height: 300px;
            overflow-y: auto;
        }

        .legend-content .item {
            display: flex;
            align-items: center;
            margin-bottom: 4px;
            font-size: 12px;
        }

        .legend-content .color-box {
            width: 20px;
            height: 15px;
            margin-right: 8px;
            border: 1px solid #ccc;
        }

        /* Processing screen */
        .processing-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            color: white;
            font-size: 18px;
        }

        .processing-screen.hidden {
            display: none;
        }

        .spinner {
            border: 4px solid #f3f3f3;
            border-top: 4px solid #3498db;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 2s linear infinite;
            margin-right: 15px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Search styles */
        .leaflet-control-search {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .search-icon {
            cursor: pointer;
            padding: 10px;
            background-color: white;
            border-radius: 5px;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
        }

        .search-input {
            margin-left: 10px;
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: 5px;
            width: 200px;
            height: 30px;
        }

        .suggestion-item {
            cursor: pointer;
            padding: 5px;
            border-bottom: 1px solid #ccc;
            background: white;
        }

        .suggestion-item:hover {
            background-color: #f3f4f6;
        }

        #suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #ccc;
            border-top: none;
            border-radius: 0 0 5px 5px;
            max-height: 200px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
        }

        /* Zone legend */
        .zone-legend {
            margin-top: 10px;
            border-top: 1px solid #e5e7eb;
            padding-top: 10px;
        }

        .zone-legend-item {
            display: flex;
            align-items: center;
            margin-bottom: 5px;
        }

        .zone-color {
            width: 20px;
            height: 20px;
            border-radius: 4px;
            margin-right: 8px;
        }

        /* Responsive design */
        @media (max-width: 768px) {
            .sidebar {
                position: absolute;
                right: 0;
                top: 60px;
                height: calc(100% - 60px);
                z-index: 2000;
                box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
            }

            .search-input {
                width: 120px;
            }
        }

        /* Ensure Leaflet controls are visible */
        .leaflet-control-container {
            z-index: 1000;
        }

        .leaflet-draw-toolbar {
            z-index: 1001;
        }

        /* Zoning legend styles */
        .zoning-legend {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background: white;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 8px;
            z-index: 1000;
            max-width: 300px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            display: none;
        }

        .zoning-legend h4 {
            margin: 0 0 10px 0;
            font-size: 14px;
            font-weight: 600;
        }

        .zoning-legend-item {
            display: flex;
            align-items: center;
            margin-bottom: 5px;
            font-size: 12px;
        }

        .zoning-legend-item .color-box {
            width: 30px;
            height: 30px;
            margin-right: 10px;
            position: relative;
            cursor: pointer;
        }

        .zoning-legend-item input[type="checkbox"] {
            position: absolute;
            opacity: 0;
            width: 100%;
            height: 100%;
            cursor: pointer;
        }
/* Back button styles */
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #f8f9fa;
    color: #374151;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.back-button:hover {
    background-color: #10b981;
    color: white;
    transform: scale(1.05);
}

.back-button:active {
    transform: scale(0.95);
}

/* Fixed Search Control Styles */
        .leaflet-control-search {
            background: white;
            border-radius: 4px;
            box-shadow: 0 1px 5px rgba(0,0,0,0.4);
            display: flex;
            align-items: center;
            overflow: visible;
            position: relative;
            min-width: 40px;
            transition: all 0.3s ease;
        }

        .search-icon {
            padding: 8px 10px;
            cursor: pointer;
            background: white;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 40px;
            height: 40px;
        }

        .search-icon:hover {
            background: #f5f5f5;
        }

        .search-input {
            border: none;
            padding: 8px 12px;
            font-size: 14px;
            width: 0;
            opacity: 0;
            outline: none;
            transition: all 0.3s ease;
            background: white;
            border-radius: 0 4px 4px 0;
        }

        .search-input.active {
            width: 200px;
            opacity: 1;
        }

        .search-suggestions {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 1px solid #ddd;
            border-top: none;
            border-radius: 0 0 4px 4px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
            max-height: 200px;
            overflow-y: auto;
            z-index: 1000;
            display: none;
        }

        .search-suggestions.active {
            display: block;
        }

        .suggestion-item {
            padding: 10px 12px;
            cursor: pointer;
            border-bottom: 1px solid #eee;
            font-size: 14px;
        }

        .suggestion-item:hover {
            background: #f5f5f5;
        }

        .suggestion-item:last-child {
            border-bottom: none;
        }

        .suggestion-name {
            font-weight: 500;
            color: #333;
        }

        .suggestion-type {
            font-size: 12px;
            color: #666;
            margin-top: 2px;
        }

/* MOBILE RESPONSIVE DESIGN */

/* Tablet View */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }
    
    .header h1 {
        font-size: 16px;
    }
    
    .header-logo span {
        font-size: 16px !important;
    }
    
    .header-logo img {
        height: 45px !important;
    }
}

/* Mobile View - Major Improvements */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    /* Mobile Header */
    .header {
        height: 60px;
        padding: 0 12px;
        gap: 8px;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    
    .header h1 {
        font-size: 14px;
        display: none; /* Hide on mobile to save space */
    }
    
    .header-logo {
        gap: 8px !important;
        flex: 1;
        justify-content: center;
    }
    
    .header-logo img {
        height: 35px !important;
    }
    
    .header-logo span {
        font-size: 14px !important;
    }
    
    .status-badges {
        gap: 4px;
    }
    
    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .back-button {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    /* Mobile Sidebar Toggle */
    .sidebar-toggle {
        display: block;
        position: fixed;
        top: 70px;
        right: 10px;
        z-index: 2001;
        background: #10b981;
        color: white;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    /* Mobile Sidebar */
    .sidebar {
        position: fixed;
        right: 0;
        top: 60px;
        height: calc(100vh - 60px);
        width: 320px;
        z-index: 2000;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-header {
        padding: 15px;
    }
    
    .sidebar-header h2 {
        font-size: 14px;
    }
    
    .sidebar-content {
        padding: 15px;
    }
    
    .sidebar-section {
        margin-bottom: 20px;
    }
    
    /* Mobile Map */
    #map {
        height: calc(100vh - 60px);
    }
    
    /* Mobile Legends */
    #prelegend, .zoning-legend {
        bottom: 80px;
        right: 5px;
        max-width: 250px;
        font-size: 12px;
    }
    
    /* Mobile Processing Screen */
    .processing-screen {
        font-size: 16px;
    }
    
    .spinner {
        width: 35px;
        height: 35px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header {
        padding: 0 8px;
        gap: 6px;
    }
    
    .header-logo img {
        height: 30px !important;
    }
    
    .header-logo span {
        font-size: 12px !important;
    }
    
    .back-button {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .sidebar {
        width: 300px;
    }
    
    .sidebar-toggle {
        width: 45px;
        height: 45px;
        font-size: 16px;
        top: 65px;
        right: 8px;
        background: #f1f5f9;
        color: #10b981;
    }
    
    .sidebar-content {
        padding: 12px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .form-select {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .status-card {
        padding: 12px;
    }
    
    .badge {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    #prelegend, .zoning-legend {
        max-width: 200px;
        padding: 8px;
        font-size: 11px;
    }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
    .header-logo span {
        display: none; /* Hide text on very small screens */
    }
    
    .sidebar {
        width: 280px;
    }
    
    .sidebar-header h2 {
        font-size: 12px;
    }
    
    .btn {
        font-size: 12px;
        padding: 6px 10px;
        min-height: 36px;
    }
    
    .form-select {
        font-size: 12px;
    }
    
    .sidebar-section h3 {
        font-size: 12px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        height: 50px;
    }
    
    .sidebar-toggle {
        top: 55px;
    }
    
    .sidebar {
        top: 50px;
        height: calc(100vh - 50px);
        width: 280px;
    }
    
    #map {
        height: calc(100vh - 50px);
    }
    
    .header-logo img {
        height: 30px !important;
    }
    
    .header-logo span {
        font-size: 12px !important;
    }
}

/* Ensure Leaflet controls are visible and responsive */
.leaflet-control-container {
    z-index: 1000;
}

.leaflet-draw-toolbar {
    z-index: 1001;
}

@media (max-width: 768px) {
    .leaflet-control-container .leaflet-top.leaflet-right {
        top: 70px;
        right: 10px;
    }
    
    .leaflet-control-container .leaflet-bottom.leaflet-right {
        bottom: 90px;
    }
}

/* Search control mobile adjustments */
@media (max-width: 768px) {
    .search-input.active {
        width: 150px;
    }
    
    .leaflet-control-search {
        margin-top: 10px;
    }
}