/* KML Polygon Creator Plugin Styles */

.kml-polygon-creator-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.kml-dashboard {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    height: 100%;
}

.kml-sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.kml-map-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.kml-header h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
}

.kml-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.kml-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 2px solid transparent;
}

.kml-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.kml-btn:active {
    transform: translateY(0);
}

.kml-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.kml-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.kml-btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.kml-btn-success {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.kml-btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.kml-btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin: 2px;
}

.kml-panel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.kml-panel h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.kml-hidden {
    display: none;
}

.kml-form-group {
    margin-bottom: 15px;
}

.kml-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.kml-form-group input,
.kml-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.kml-form-group input:focus,
.kml-form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.kml-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.kml-coord-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.kml-point-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 15px 0;
}

.kml-point-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.kml-point-info {
    flex: 1;
}

.kml-point-info strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.kml-point-coords {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #666;
}

.kml-point-actions {
    display: flex;
    gap: 5px;
}

.kml-polygon-list {
    max-height: 400px;
    overflow-y: auto;
}

.kml-polygon-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.kml-polygon-item h5 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.kml-polygon-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.kml-polygon-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.kml-status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    display: none;
}

.kml-status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kml-status-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.kml-status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

#kml-map {
    height: 100%;
    min-height: 400px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Estilos para el área de administración */
.kml-admin-content {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.kml-admin-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.kml-admin-info h3 {
    margin-top: 0;
    color: #333;
}

.kml-admin-info h4 {
    color: #495057;
    margin-top: 20px;
}

.kml-admin-info code {
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.kml-admin-info ul {
    margin-left: 20px;
}

.kml-admin-info li {
    margin-bottom: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kml-dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .kml-sidebar {
        height: auto;
        max-height: 500px;
    }
    
    .kml-coord-inputs {
        grid-template-columns: 1fr;
    }
    
    .kml-controls {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .kml-btn {
        flex: 1;
        min-width: 120px;
    }
    
    .kml-polygon-actions {
        justify-content: center;
    }
    
    .kml-point-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .kml-point-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .kml-polygon-creator-container {
        padding: 10px;
    }
    
    .kml-dashboard {
        gap: 10px;
    }
    
    .kml-sidebar {
        padding: 15px;
    }
    
    .kml-map-container {
        padding: 10px;
    }
    
    .kml-controls {
        flex-direction: column;
    }
    
    .kml-btn {
        min-width: auto;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kml-panel:not(.kml-hidden) {
    animation: fadeIn 0.3s ease;
}

.kml-point-item,
.kml-polygon-item {
    animation: fadeIn 0.3s ease;
}

/* Estilos para iconos de WordPress */
.kml-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Mejoras visuales */
.kml-sidebar::-webkit-scrollbar {
    width: 6px;
}

.kml-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.kml-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.kml-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.kml-point-list::-webkit-scrollbar,
.kml-polygon-list::-webkit-scrollbar {
    width: 4px;
}

.kml-point-list::-webkit-scrollbar-track,
.kml-polygon-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.kml-point-list::-webkit-scrollbar-thumb,
.kml-polygon-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

/* Estados de loading */
.kml-loading {
    opacity: 0.6;
    pointer-events: none;
}

.kml-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}