/* Responsive Admin Panel Styles */

/* Control Sidebar Responsive */
.control-sidebar {
    min-width: 280px !important;
    width: 320px !important;
}

.control-sidebar .p-3 {
    padding: 1rem !important;
}

/* Títulos más compactos */
.control-sidebar h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.control-sidebar h6 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

/* Botones más compactos */
.control-sidebar .btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.control-sidebar .btn-block {
    width: 100%;
    display: block;
}

/* Iconos más pequeños */
.control-sidebar .btn i {
    font-size: 0.75rem;
    margin-right: 0.25rem;
}

/* Filas más compactas */
.control-sidebar .row {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
}

.control-sidebar .col-12 {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

/* Secciones más compactas */
.control-sidebar .mb-4 {
    margin-bottom: 1rem !important;
}

.control-sidebar .mb-3 {
    margin-bottom: 0.5rem !important;
}

.control-sidebar .mb-2 {
    margin-bottom: 0.25rem !important;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .control-sidebar {
        width: 300px !important;
        min-width: 300px !important;
    }
    
    .control-sidebar .btn {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
    
    .control-sidebar h5 {
        font-size: 0.95rem;
    }
    
    .control-sidebar h6 {
        font-size: 0.8rem;
    }
}

@media (max-width: 992px) {
    .control-sidebar {
        width: 280px !important;
        min-width: 280px !important;
    }
    
    .control-sidebar .btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.3rem;
    }
    
    .control-sidebar h5 {
        font-size: 0.9rem;
    }
    
    .control-sidebar h6 {
        font-size: 0.75rem;
    }
    
    .control-sidebar .p-3 {
        padding: 0.75rem !important;
    }
}

@media (max-width: 768px) {
    .control-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        position: fixed !important;
        z-index: 1050;
        height: 100vh;
        overflow-y: auto;
    }
    
    .control-sidebar .btn {
        font-size: 0.7rem;
        padding: 0.375rem 0.5rem;
    }
    
    .control-sidebar h5 {
        font-size: 1rem;
    }
    
    .control-sidebar h6 {
        font-size: 0.85rem;
    }
    
    .control-sidebar .p-3 {
        padding: 1rem !important;
    }
    
    /* Botones en dos columnas en móviles */
    .control-sidebar .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .control-sidebar {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .control-sidebar .btn {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
        margin-bottom: 0.15rem;
    }
    
    .control-sidebar h5 {
        font-size: 0.95rem;
    }
    
    .control-sidebar h6 {
        font-size: 0.8rem;
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .control-sidebar .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    .control-sidebar .p-3 {
        padding: 0.75rem !important;
    }
}

/* Mejoras para el scroll */
.control-sidebar {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.control-sidebar::-webkit-scrollbar {
    width: 6px;
}

.control-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.control-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.control-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* Animaciones suaves */
.control-sidebar .btn {
    transition: all 0.2s ease-in-out;
}

.control-sidebar .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Fix para el overlay en pantallas pequeñas */
@media (max-width: 768px) {
    .control-sidebar-open .control-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
    
    body.control-sidebar-slide-open {
        overflow: hidden;
    }
}

/* Optimizaciones adicionales para zoom */
.control-sidebar {
    zoom: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
    transform-origin: top left;
}

/* Meta viewport fix para evitar problemas de zoom */
@viewport {
    width: device-width;
    initial-scale: 1;
    maximum-scale: 1;
    user-scalable: no;
}

/* Estilos para el botón de cerrar en móviles */
@media (max-width: 768px) {
    .control-sidebar::before {
        content: "×";
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 1.5rem;
        color: white;
        cursor: pointer;
        z-index: 1051;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 50%;
    }
}