* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #ad0a23;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    width: 60px;
    height: 60px;
    background-color: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.app-name {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: 50px;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-weight: 600;
    color: #2c3e50;
}

.toggle-sidebar {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1.2rem;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.layers-panel, .attributes-panel {
    flex: 1;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 5px;
}

.layer-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.layer-item:hover {
    background-color: #e9ecef;
}

.layer-item:last-child {
    border-bottom: none;
}

.layer-checkbox {
    margin-right: 10px;
}

.layer-name {
    flex: 1;
    font-size: 0.9rem;
    user-select: none;
}

.layer-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.layer-item:hover .layer-actions {
    opacity: 1;
}

.layer-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 0.9rem;
    padding: 4px;
    border-radius: 3px;
}

.layer-action-btn:hover {
    background-color: #dee2e6;
    color: #495057;
}

/* Attributes Panel */
.attributes-content {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
}

.no-attributes {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 0;
}

.attributes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.attributes-table th,
.attributes-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.attributes-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.attributes-table tr:hover {
    background-color: #f8f9fa;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* Leaflet Draw Customization */
.leaflet-draw-toolbar {
    margin-top: 10px !important;
}

.leaflet-draw-toolbar a {
    background-color: white !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    margin: 2px !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
}

.leaflet-draw-toolbar a:hover {
    background-color: #f8f9fa !important;
}

.leaflet-draw-actions {
    background: white !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.leaflet-draw-actions li {
    border-bottom: 1px solid #eee !important;
}

.leaflet-draw-actions li:last-child {
    border-bottom: none !important;
}

.leaflet-draw-actions a {
    color: #495057 !important;
    padding: 8px 12px !important;
}

.leaflet-draw-actions a:hover {
    background-color: #3498db !important;
    color: white !important;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    max-width: 350px;
    cursor: pointer;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

.notification.info {
    background-color: #17a2b8;
}

.notification.warning {
    background-color: #ffc107;
    color: #212529;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    display: none;
    min-width: 200px;
}

.context-menu ul {
    list-style: none;
    margin: 0;
    padding: 5px 0;
}

.context-menu li {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.context-menu li:hover {
    background-color: #3498db;
    color: white;
}

.context-menu li i {
    width: 16px;
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 400px;
    max-width: 500px;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
}

.close-modal:hover {
    color: #495057;
}

.modal-body {
    padding: 20px;
}

.modal-body input {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1rem;
}

.modal-body input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 500;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 350px;
    }
    
    .modal-content {
        min-width: 90%;
        margin: 20px;
    }
}

/* Scrollbar Customization */
.layer-list::-webkit-scrollbar,
.attributes-content::-webkit-scrollbar {
    width: 6px;
}

.layer-list::-webkit-scrollbar-track,
.attributes-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.layer-list::-webkit-scrollbar-thumb,
.attributes-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.layer-list::-webkit-scrollbar-thumb:hover,
.attributes-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ... (mantenha todo o CSS anterior e adicione estas novas regras) */

/* Dropdown para exportação */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
    overflow: hidden;
}

.dropdown-content a {
    color: #333;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
}

.dropdown-content a:hover {
    background-color: #3498db;
    color: white;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Style Panel */
.style-panel {
    margin-bottom: 20px;
}

.style-content {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    padding: 15px;
}

.style-control {
    margin-bottom: 15px;
}

.style-control label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.style-control input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
}

.style-control input[type="range"] {
    width: 100%;
}

/* ... (mantenha todo o CSS anterior) */

/* ... (mantenha todo o CSS anterior) */

/* Leaflet Draw Customization - CORREÇÕES ESPECÍFICAS */
.leaflet-draw-toolbar {
    margin-top: 10px !important;
    border: none !important;
    background: transparent !important;
}

.leaflet-draw-toolbar a {
    background-color: white !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 6px !important;
    margin: 4px !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    position: relative !important;
}

.leaflet-draw-toolbar a:hover {
    background-color: #3498db !important;
    border-color: #3498db !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3) !important;
}

/* REMOVER COMPLETAMENTE os ícones padrão duplicados */
.leaflet-draw-toolbar a .leaflet-draw-icon {
    background-image: none !important;
    width: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
    display: none !important;
}

/* REMOVER ícones de texto */
.leaflet-draw-toolbar a .leaflet-draw-tooltip {
    display: none !important;
}

/* Ícones SVG customizados - CORRIGIDOS */
.leaflet-draw-toolbar .leaflet-draw-draw-marker {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
}

.leaflet-draw-toolbar .leaflet-draw-draw-marker:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E") !important;
}

.leaflet-draw-toolbar .leaflet-draw-draw-polyline {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'%3E%3C/path%3E%3Cpath d='M19 9L5 15'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
}

.leaflet-draw-toolbar .leaflet-draw-draw-polyline:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'%3E%3C/path%3E%3Cpath d='M19 9L5 15'%3E%3C/path%3E%3C/svg%3E") !important;
}

.leaflet-draw-toolbar .leaflet-draw-draw-polygon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2'%3E%3C/polygon%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
}

.leaflet-draw-toolbar .leaflet-draw-draw-polygon:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2'%3E%3C/polygon%3E%3C/svg%3E") !important;
}

.leaflet-draw-toolbar .leaflet-draw-draw-rectangle {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
}

.leaflet-draw-toolbar .leaflet-draw-draw-rectangle:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3C/svg%3E") !important;
}

/* ÍCONES DE EDITAR E EXCLUIR - CORRIGIDOS */
.leaflet-draw-toolbar .leaflet-draw-edit-edit {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'%3E%3C/path%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
}

.leaflet-draw-toolbar .leaflet-draw-edit-edit:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'%3E%3C/path%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'%3E%3C/path%3E%3C/svg%3E") !important;
}

.leaflet-draw-toolbar .leaflet-draw-edit-remove {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3Cline x1='10' y1='11' x2='10' y2='17'%3E%3C/line%3E%3Cline x1='14' y1='11' x2='14' y2='17'%3E%3C/line%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 22px 22px !important;
}

.leaflet-draw-toolbar .leaflet-draw-edit-remove:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3Cline x1='10' y1='11' x2='10' y2='17'%3E%3C/line%3E%3Cline x1='14' y1='11' x2='14' y2='17'%3E%3C/line%3E%3C/svg%3E") !important;
}

/* Garantir que os ícones do Leaflet Draw sejam os únicos visíveis */
.leaflet-draw-toolbar a:before {
    display: none !important;
}

.leaflet-bar {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.leaflet-control-zoom a {
    background-color: white !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 6px !important;
    color: #333 !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
}

.leaflet-control-zoom a:hover {
    background-color: #3498db !important;
    border-color: #3498db !important;
    color: white !important;
    transform: translateY(-1px) !important;
}

.leaflet-draw-actions {
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid #dee2e6 !important;
    overflow: hidden !important;
}

.leaflet-draw-actions li {
    border-bottom: 1px solid #f1f3f4 !important;
    margin: 0 !important;
}

.leaflet-draw-actions li:last-child {
    border-bottom: none !important;
}

.leaflet-draw-actions a {
    color: #495057 !important;
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
    text-decoration: none !important;
    display: block !important;
    transition: all 0.2s ease !important;
}

.leaflet-draw-actions a:hover {
    background-color: #3498db !important;
    color: white !important;
}

/* Layer List - Ícones sempre visíveis - CORRIGIDO */
.layer-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    margin: 0;
    padding: 0;
}

.layer-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.layer-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.layer-item:last-child {
    border-bottom: none;
}

.layer-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #3498db;
}

.layer-checkbox {
    margin-right: 12px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.layer-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: #2c3e50;
    user-select: none;
    padding-right: 10px;
    min-width: 0; /* Permite que o texto quebre */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-actions {
    display: flex !important; /* FORÇAR display */
    gap: 6px;
    opacity: 1 !important; /* Sempre visível */
    visibility: visible !important;
    flex-shrink: 0; /* Não encolher */
}

.layer-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 0.8rem; /* Um pouco menor */
    padding: 5px;
    border-radius: 4px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.layer-action-btn:hover {
    background-color: #3498db;
    color: white;
    transform: scale(1.1);
}

.layer-action-btn.zoom-btn:hover {
    background-color: #28a745;
}

.layer-action-btn.style-btn:hover {
    background-color: #6f42c1;
}

.layer-action-btn.rename-btn:hover {
    background-color: #fd7e14;
}

.layer-action-btn.remove-btn:hover {
    background-color: #dc3545;
}

/* Style Panel - RECOLHÍVEL */
.style-panel {
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.style-panel-header {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.style-panel-header:hover {
    background-color: #e9ecef;
}

.style-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.style-panel-toggle {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.style-panel-toggle.rotated {
    transform: rotate(180deg);
}

.style-panel-content {
    padding: 15px;
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.style-panel-content.collapsed {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

.style-control {
    margin-bottom: 15px;
}

.style-control label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
}

.style-control input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.style-control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
}

.style-control input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.style-control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
}

#apply-style {
    width: 100%;
    margin-top: 10px;
}

/* Ajustes para painéis */
.layers-panel {
    margin-bottom: 20px;
}

.panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

/* Remover context menu já que não é mais usado */
.context-menu {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .leaflet-draw-toolbar a {
        width: 40px !important;
        height: 40px !important;
        margin: 3px !important;
    }
    
    .layer-item {
        padding: 10px 12px;
    }
    
    .layer-actions {
        gap: 4px;
    }
    
    .layer-action-btn {
        width: 24px;
        height: 24px;
        padding: 4px;
        font-size: 0.75rem;
    }
    
    .layer-name {
        font-size: 0.85rem;
    }
}

/* Scrollbar Customization */
.layer-list::-webkit-scrollbar {
    width: 6px;
}

.layer-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.layer-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.layer-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ... (mantenha todo o CSS anterior) */

/* Logo */
.logo-img {
    width: 40px;
    height: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header Actions - Novos botões */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Sidebars - Esquerda e Direita */
.sidebar {
    width: 350px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.left-sidebar {
    border-right: 1px solid #dee2e6;
}

.right-sidebar {
    border-left: 1px solid #dee2e6;
}

.sidebar.collapsed {
    width: 50px;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
}

.sidebar-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.toggle-sidebar {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toggle-sidebar:hover {
    background-color: #e9ecef;
    color: #495057;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Right Sidebar - Atributos */
.right-sidebar .attributes-panel {
    flex: 1;
}

.right-sidebar .attributes-content {
    border: none;
    background: transparent;
    max-height: none;
    padding: 0;
}

.right-sidebar .no-attributes {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 20px 0;
}

/* Main Content com sidebars */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.map-container {
    flex: 1;
    position: relative;
    min-width: 0; /* Permite que o mapa encolha */
}

/* Ajustes para painéis nas sidebars */
.layers-panel, .style-panel, .attributes-panel {
    flex: 1;
}

/* Atributos no painel direito */
.attributes-content {
    height: 100%;
}

.attributes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.attributes-table th,
.attributes-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.attributes-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.attributes-table tr:hover {
    background-color: #f8f9fa;
}

/* Geometry attributes styling */
.geometry-attribute {
    font-weight: 600;
    color: #2c3e50;
    background-color: #e3f2fd !important;
}

.geometry-value {
    font-family: 'Courier New', monospace;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    border: 1px solid #e9ecef;
}

/* Botões de zoom no header */
#zoom-all-btn, #full-extents-btn {
    padding: 8px 12px;
    min-width: auto;
}

/* Manual button */
#manual-btn {
    background-color: #6f42c1;
}

#manual-btn:hover {
    background-color: #5a32a3;
}

/* Responsive */
@media (max-width: 1200px) {
    .sidebar {
        width: 300px;
    }
    
    .sidebar.collapsed {
        width: 50px;
    }
}

@media (max-width: 768px) {
    .header-actions {
        gap: 5px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .btn span {
        display: none;
    }
    
    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 500;
    }
    
    .left-sidebar {
        transform: translateX(-100%);
    }
    
    .left-sidebar.open {
        transform: translateX(0);
    }
    
    .right-sidebar {
        transform: translateX(100%);
        right: 0;
    }
    
    .right-sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.collapsed {
        width: 300px;
    }
}

/* Ajustes para quando ambas as sidebars estão abertas */
@media (min-width: 1400px) {
    .sidebar {
        width: 320px;
    }
}

/* Ajustes para conteúdo dos atributos no painel direito */
.attributes-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.attributes-panel .panel-title {
    margin-bottom: 15px;
}

/* Scrollbar para conteúdo longo nos atributos */
.attributes-content::-webkit-scrollbar {
    width: 6px;
}

.attributes-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.attributes-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.attributes-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ... (mantenha todo o CSS anterior) */

/* Sidebars - Correções de recolhimento */
.sidebar {
    width: 350px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
    flex-shrink: 0; /* Impede que a sidebar encolha */
}

.left-sidebar {
    border-right: 1px solid #dee2e6;
}

.right-sidebar {
    border-left: 1px solid #dee2e6;
}

/* Sidebar recolhida - CORREÇÃO */
.sidebar.collapsed {
    width: 50px !important; /* Forçar largura */
    min-width: 50px !important;
}

/* Header da sidebar recolhida - CORREÇÃO */
.sidebar.collapsed .sidebar-header {
    padding: 15px 12px;
    justify-content: center;
}

.sidebar.collapsed .sidebar-title {
    display: none; /* Esconder título quando recolhido */
}

.sidebar.collapsed .sidebar-content {
    display: none; /* Esconder conteúdo quando recolhido */
}

/* Toggle buttons - CORREÇÃO */
.toggle-sidebar {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toggle-sidebar:hover {
    background-color: #e9ecef;
    color: #495057;
}

/* Correção específica para setas quando recolhido */
.left-sidebar.collapsed .toggle-sidebar i {
    transform: rotate(0deg); /* Reset para seta padrão */
}

.left-sidebar:not(.collapsed) .toggle-sidebar i {
    transform: rotate(0deg); /* Seta para esquerda quando expandido */
}

.right-sidebar.collapsed .toggle-sidebar i {
    transform: rotate(180deg); /* Seta para esquerda quando recolhido */
}

.right-sidebar:not(.collapsed) .toggle-sidebar i {
    transform: rotate(0deg); /* Seta para direita quando expandido */
}

/* Main Content com sidebars - CORREÇÃO */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-width: 0; /* Permite que os filhos encolham */
}

.map-container {
    flex: 1;
    position: relative;
    min-width: 0; /* Permite que o mapa encolha */
    background-color: #f8f9fa; /* Cor de fundo para áreas não preenchidas */
    transition: all 0.3s ease; /* Transição suave */
}

/* Garantir que o mapa ocupe todo o espaço disponível */
#map {
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

/* Quando ambas as sidebars estão recolhidas, o mapa expande */
.left-sidebar.collapsed ~ .map-container,
.right-sidebar.collapsed ~ .map-container {
    margin-left: 0;
    margin-right: 0;
}

/* Ajustes para conteúdo dos painéis */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Garantir que os painéis internos se expandam corretamente */
.layers-panel, .style-panel, .attributes-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Permite scroll */
}

.layer-list {
    flex: 1;
    max-height: none; /* Remover altura máxima fixa */
}

.attributes-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Permite scroll */
}

/* Ajustes para responsividade */
@media (max-width: 1200px) {
    .sidebar {
        width: 320px;
    }
    
    .sidebar.collapsed {
        width: 50px !important;
    }
}

@media (max-width: 768px) {
    .header-actions {
        gap: 5px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .btn span {
        display: none;
    }
    
    .sidebar {
        position: absolute;
        height: 100%;
        z-index: 500;
        width: 300px !important; /* Largura fixa no mobile */
    }
    
    .left-sidebar {
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .left-sidebar.open {
        transform: translateX(0);
    }
    
    .left-sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .right-sidebar {
        right: 0;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .right-sidebar.open {
        transform: translateX(0);
    }
    
    .right-sidebar.collapsed {
        transform: translateX(100%);
    }
    
    /* No mobile, quando sidebar está recolhida, ela some completamente */
    .sidebar.collapsed {
        width: 0 !important;
        min-width: 0 !important;
        border: none;
    }
    
    .sidebar.collapsed .sidebar-header {
        display: none;
    }
    
    /* Botões flutuantes para abrir sidebars no mobile */
    .mobile-sidebar-toggle {
        position: absolute;
        top: 70px;
        z-index: 1000;
        background: white;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        padding: 8px;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .mobile-left-toggle {
        left: 10px;
    }
    
    .mobile-right-toggle {
        right: 10px;
    }
}

/* Ajustes para quando ambas as sidebars estão abertas */
@media (min-width: 1400px) {
    .sidebar {
        width: 320px;
    }
}

/* Garantir que o mapa se expanda corretamente quando sidebars recolhem */
.left-sidebar.collapsed + .map-container {
    margin-left: 0;
}

.map-container:has(~ .right-sidebar.collapsed) {
    margin-right: 0;
}

/* Estado inicial - garantir que tudo esteja visível */
.sidebar:not(.collapsed) {
    width: 350px;
}

/* Ajustes específicos para o painel de atributos no lado direito */
.right-sidebar .attributes-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.right-sidebar .attributes-content {
    flex: 1;
    overflow-y: auto;
}

/* Correção para o estilo do painel */
.style-panel {
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    overflow: hidden;
}

.style-panel-header {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.style-panel-header:hover {
    background-color: #e9ecef;
}

.style-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.style-panel-toggle {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.3s ease;
    padding: 4px;
    border-radius: 4px;
}

.style-panel-toggle:hover {
    background-color: #e9ecef;
}

.style-panel-toggle.rotated {
    transform: rotate(180deg);
}

.style-panel-content {
    padding: 15px;
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.style-panel-content.collapsed {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
}

/* Garantir que os botões do header fiquem visíveis */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Loading state para o mapa */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* ... (mantenha todo o CSS anterior) */

/* Zoom Controls Panel - Design mais discreto */
.zoom-controls-panel {
    margin-bottom: 20px;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.zoom-controls-panel .panel-title {
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
}

.zoom-controls-panel .panel-title i {
    font-size: 0.9rem;
    color: #6c757d;
}

.zoom-controls-buttons {
    display: flex;
    gap: 8px;
}

.zoom-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px !important;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    transition: all 0.2s ease;
    flex: 1;
}

.zoom-btn:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.zoom-btn i {
    font-size: 0.9rem;
    color: #6c757d;
}

.zoom-btn span {
    font-size: 0.8rem;
}

/* Remover fundo verde dos botões de zoom das camadas */
.layer-action-btn.zoom-btn {
    background-color: transparent !important;
    border: 1px solid transparent !important;
    color: #6c757d !important;
}

.layer-action-btn.zoom-btn:hover {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

/* Ajustes para Layers Panel - Expansão dinâmica */
.layers-panel {
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: flex 0.3s ease;
}

/* Quando o style panel está recolhido, expandir o layers panel */
.style-panel-content.collapsed ~ .layers-panel {
    flex: 2; /* Expande mais quando o style panel está recolhido */
}

.layer-list {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

/* Ajustes para quando há muitas camadas */
.layer-list:has(.layer-item:nth-child(n+8)) {
    max-height: 400px; /* Limite máximo quando há muitas camadas */
}

/* Ajustes para o painel de estilo recolhido */
.style-panel-content.collapsed ~ .layers-panel .layer-list {
    max-height: 500px; /* Mais espaço quando style panel está recolhido */
}

/* Ajustes para o container do sidebar content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Reduzido o gap */
    min-height: 0;
}

/* Ajustes para os painéis individuais */
.zoom-controls-panel, .layers-panel, .style-panel {
    flex-shrink: 0;
}

/* Layers panel ocupa espaço disponível */
.layers-panel {
    flex: 1;
    min-height: 200px; /* Altura mínima */
}

/* Ajustes para o style panel */
.style-panel {
    margin-bottom: 0;
    flex-shrink: 0;
}

.style-panel-content:not(.collapsed) {
    max-height: 300px; /* Altura máxima quando expandido */
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    .zoom-controls-buttons {
        flex-direction: row;
    }
    
    .zoom-btn {
        flex: 1;
        min-width: auto;
    }
    
    .zoom-btn span {
        display: none; /* Esconder texto no mobile */
    }
    
    .zoom-btn i {
        margin: 0;
        font-size: 1rem;
    }
    
    /* Ajustes para mobile */
    .layers-panel {
        min-height: 150px;
    }
    
    .style-panel-content:not(.collapsed) {
        max-height: 250px;
    }
}

/* Ajustes para telas grandes */
@media (min-width: 1200px) {
    .layers-panel {
        min-height: 250px;
    }
    
    .style-panel-content:not(.collapsed) {
        max-height: 350px;
    }
}

/* Tooltips para botões de zoom - mais discreto */
.zoom-btn:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #495057;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    font-weight: normal;
}

/* Ajustes para os botões de ação das camadas */
.layer-actions {
    display: flex;
    gap: 4px; /* Reduzido o gap */
    opacity: 1 !important;
    visibility: visible !important;
    flex-shrink: 0;
}

.layer-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    font-size: 0.8rem;
    padding: 4px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 24px; /* Um pouco menor */
    height: 24px;
    flex-shrink: 0;
}

.layer-action-btn:hover {
    background-color: #3498db;
    color: white;
    transform: scale(1.05);
}

/* Cores específicas para cada botão - mais suaves */
.layer-action-btn.zoom-btn:hover {
    background-color: #28a745 !important;
}

.layer-action-btn.style-btn:hover {
    background-color: #6f42c1 !important;
}

.layer-action-btn.rename-btn:hover {
    background-color: #fd7e14 !important;
}

.layer-action-btn.remove-btn:hover {
    background-color: #dc3545 !important;
}

/* Ajustes para o layout geral quando sidebars estão recolhidas */
.sidebar.collapsed .zoom-controls-panel,
.sidebar.collapsed .layers-panel,
.sidebar.collapsed .style-panel {
    display: none;
}

/* Melhorias na scrollbar */
.layer-list::-webkit-scrollbar {
    width: 4px;
}

.layer-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.layer-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.layer-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Estados vazios */
.layer-list:empty::before {
    content: "Nenhuma camada carregada";
    display: block;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* Ajustes para quando há poucas camadas */
.layer-list:has(.layer-item:nth-child(-n+3)) {
    max-height: none; /* Não limitar altura quando há poucas camadas */
}

/* ... (mantenha todo o CSS anterior) */

/* Zoom Controls Panel - Barra horizontal de botões quadrados */
.zoom-controls-panel {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.zoom-controls-panel .panel-title {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
}

.zoom-controls-panel .panel-title i {
    font-size: 0.85rem;
    color: #6c757d;
}

.zoom-controls-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

/* Botões de zoom quadrados */
.zoom-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px !important;
    font-size: 0.8rem;
    font-weight: 500;
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    transition: all 0.2s ease;
    border-radius: 4px;
    width: 36px; /* Largura fixa para quadrado */
    height: 36px; /* Altura fixa para quadrado */
    min-width: 36px; /* Garante que não encolha */
    flex-shrink: 0; /* Impede que o botão encolha */
}

.zoom-btn:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.zoom-btn i {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0; /* Remove qualquer margem */
}

/* Esconder texto nos botões quadrados */
.zoom-btn span {
    display: none;
}

/* Tooltips para botões de zoom */
.zoom-btn {
    position: relative;
}

.zoom-btn:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #495057;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    font-weight: normal;
}

/* Ajustes para o layout dos painéis com a nova barra de zoom */
.layers-panel {
    margin-bottom: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: flex 0.3s ease;
}

/* Quando o style panel está recolhido, expandir o layers panel */
.style-panel-content.collapsed ~ .layers-panel {
    flex: 2;
}

/* Ajustes responsivos para a barra de zoom */
@media (max-width: 768px) {
    .zoom-controls-panel {
        padding: 8px;
    }
    
    .zoom-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 6px !important;
    }
    
    .zoom-btn i {
        font-size: 0.85rem;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    .zoom-controls-buttons {
        gap: 4px;
    }
    
    .zoom-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        padding: 5px !important;
    }
    
    .zoom-btn i {
        font-size: 0.8rem;
    }
}

/* Estados dos botões de zoom */
.zoom-btn:active {
    transform: translateY(0);
    background-color: #dee2e6 !important;
}

/* Foco acessibilidade */
.zoom-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 1px;
}

/* Ajustes para o container do sidebar com a nova barra */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Gap reduzido */
    min-height: 0;
}

/* Ajustes específicos para o painel de zoom */
.zoom-controls-panel {
    flex-shrink: 0;
    margin-bottom: 12px;
}

/* Garantir que os botões fiquem centralizados horizontalmente */
.zoom-controls-buttons {
    width: 100%;
}

/* Ajustes para quando há poucas camadas - melhor aproveitamento do espaço */
.layer-list:has(.layer-item:nth-child(-n+2)) {
    min-height: 80px;
}

/* Ajustes para scroll da lista de camadas */
.layer-list {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
    min-height: 120px; /* Altura mínima garantida */
}

/* Quando o style panel está recolhido, dar mais espaço para a lista */
.style-panel-content.collapsed ~ .layers-panel .layer-list {
    min-height: 200px;
    max-height: 500px;
}

/* Estados de empty state */
.layer-list:empty::before {
    content: "Nenhuma camada carregada";
    display: block;
    padding: 30px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 0.85rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 5px;
}

/* ... (mantenha todo o CSS anterior) */

/* Zoom Controls Panel - CORREÇÃO: Barra horizontal fixa */
.zoom-controls-panel {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    width: 100%; /* Garantir largura total */
}

.zoom-controls-panel .panel-title {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
}

.zoom-controls-panel .panel-title i {
    font-size: 0.85rem;
    color: #6c757d;
}

/* CORREÇÃO PRINCIPAL: Barra horizontal com flex row */
.zoom-controls-buttons {
    display: flex !important; /* FORÇAR flex */
    flex-direction: row !important; /* FORÇAR horizontal */
    gap: 8px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* CORREÇÃO: Botões de zoom quadrados lado a lado */
.zoom-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px !important;
    font-size: 0.8rem;
    font-weight: 500;
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    transition: all 0.2s ease;
    border-radius: 4px;
    width: 40px; /* Largura fixa */
    height: 40px; /* Altura fixa */
    min-width: 40px !important; /* IMPEDIR quebra */
    flex-shrink: 0 !important; /* IMPEDIR encolhimento */
    flex-grow: 0 !important; /* IMPEDIR expansão */
}

.zoom-btn:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.zoom-btn i {
    font-size: 1rem;
    color: #6c757d;
    margin: 0;
}

/* Garantir que o texto fique escondido */
.zoom-btn span {
    display: none !important;
}

/* Tooltips para botões de zoom */
.zoom-btn {
    position: relative;
}

.zoom-btn:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #495057;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    font-weight: normal;
}

/* CORREÇÃO: Garantir que não haja quebra de linha */
.zoom-controls-buttons {
    white-space: nowrap;
    overflow: visible;
}

/* Reset de qualquer estilo que possa estar causando quebra */
.zoom-btn {
    float: none !important;
    display: inline-flex !important;
    vertical-align: top !important;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    .zoom-controls-panel {
        padding: 8px;
    }
    
    .zoom-controls-buttons {
        gap: 6px;
    }
    
    .zoom-btn {
        width: 36px;
        height: 36px;
        min-width: 36px !important;
        padding: 6px !important;
    }
    
    .zoom-btn i {
        font-size: 0.9rem;
    }
}

/* Ajustes para telas muito pequenas */
@media (max-width: 480px) {
    .zoom-controls-buttons {
        gap: 4px;
    }
    
    .zoom-btn {
        width: 34px;
        height: 34px;
        min-width: 34px !important;
        padding: 5px !important;
    }
    
    .zoom-btn i {
        font-size: 0.85rem;
    }
}

/* Estados dos botões */
.zoom-btn:active {
    transform: translateY(0);
    background-color: #dee2e6 !important;
}

/* Foco acessibilidade */
.zoom-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 1px;
}

/* CORREÇÃO: Garantir que o container não force quebra */
.zoom-controls-panel {
    min-width: 0; /* Permitir que o container encolha se necessário */
}

/* Debug visual - remover depois de testar */
.zoom-controls-buttons {
    border: 1px dashed transparent; /* Para debug visual */
}

/* Se ainda estiver quebrando, forçar layout inline */
.zoom-controls-buttons {
    display: flex !important;
    flex-wrap: nowrap !important; /* IMPEDIR quebra de linha */
}

/* Modal de Exportação */
.export-option {
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-option:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
}

.export-option input[type="radio"] {
    margin-right: 8px;
}

.layer-selection-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    background: #f8f9fa;
}

.layer-selection-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}

.layer-selection-item:hover {
    background-color: #e9ecef;
}

.layer-selection-item input[type="radio"] {
    margin: 0;
}

/* Estilos para o painel de medição */
.measurement-panel {
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.measurement-panel .panel-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
}

.close-panel {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.close-panel:hover {
    background-color: #e9ecef;
    color: #495057;
}

.measurement-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.measure-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px !important;
    font-size: 0.8rem;
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    border-radius: 4px;
    flex: 1;
    transition: all 0.2s ease;
}

.measure-btn:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
}

.measure-btn.active {
    background-color: #3498db !important;
    border-color: #3498db !important;
    color: white !important;
}

.measurement-results {
    margin-bottom: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.85rem;
}

.result-item {
    margin-bottom: 4px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.measurement-instructions {
    font-size: 0.75rem;
    color: #6c757d;
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
}

.measurement-instructions p {
    margin: 0;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    .measurement-buttons {
        flex-direction: column;
    }
    
    .measure-btn {
        min-width: auto;
    }
    
    .measure-btn span {
        display: none;
    }
}