﻿
/* ========== PANEL LATERAL DE CONFIGURACIÓN ========== */

/* Botón flotante para abrir el panel */
.config-toggle-btn {
    position: fixed;
    bottom: 80px; /* Aumentado de 20px a 80px para subir el botón */
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .config-toggle-btn:hover {
        transform: scale(1.1) rotate(90deg);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }

    .config-toggle-btn:active {
        transform: scale(0.95);
    }

/* Panel lateral deslizable */
.config-side-panel {
    position: fixed;
    top: 0;
    right: -400px; /* Oculto por defecto */
    width: 350px;
    height: 100vh;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .config-side-panel.open {
        right: 0;
    }

/* Header del panel */
.config-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

    .config-panel-header h5 {
        margin: 0;
        font-weight: 600;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
    }

.btn-close-panel {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

    .btn-close-panel:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }

/* Cuerpo del panel */
.config-panel-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

    .config-panel-body .form-label {
        font-weight: 600;
        color: #495057;
        margin-bottom: 0.5rem;
    }

    .config-panel-body .form-control {
        border: 1px solid #ced4da;
        border-radius: 0.375rem;
        padding: 0.625rem;
        transition: all 0.2s ease;
    }

        .config-panel-body .form-control:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        }

/* Overlay oscuro de fondo */
.config-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

    .config-overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* Responsive - Móviles */
@media (max-width: 576px) {
    .config-toggle-btn {
        width: 48px;
        height: 48px;
        bottom: 70px; /* Aumentado de 15px a 70px para móviles */
        right: 15px;
        font-size: 1.25rem;
    }

    .config-side-panel {
        width: 90vw;
        right: -90vw;
    }

    .config-panel-header {
        padding: 1rem;
    }

        .config-panel-header h5 {
            font-size: 1rem;
        }

    .config-panel-body {
        padding: 1rem;
    }
}

/* Tablets */
@media (min-width: 577px) and (max-width: 768px) {
    .config-side-panel {
        width: 320px;
        right: -320px;
    }

    .config-toggle-btn {
        bottom: 75px; /* Posición intermedia para tablets */
    }
}

/* Desktop grande */
@media (min-width: 1200px) {
    .config-toggle-btn {
        bottom: 90px; /* Más espacio en pantallas grandes */
    }
}

/* Animación suave para los botones dentro del panel */
.config-panel-body .btn {
    transition: all 0.3s ease;
}

    .config-panel-body .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .config-panel-body .btn:active {
        transform: translateY(0);
    }

/* Scrollbar personalizado para el panel */
.config-panel-body::-webkit-scrollbar {
    width: 6px;
}

.config-panel-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.config-panel-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

    .config-panel-body::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
