﻿/**`n * =====================================================`n * ESTILOS MEJORADOS PARA HEADER Y MODALES`n * =====================================================`n */

/* ===================================
   HEADER - ÁREA DE USUARIO
   =================================== */

/* Logo mejorado */
.main-header .logo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    transition: all 0.3s ease;
}

.main-header .logo:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.main-header .logo-lg b {
    font-weight: 700;
    letter-spacing: 1px;
}

/* Navbar mejorada */
.main-header .navbar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Botón de toggle del sidebar */
.sidebar-toggle {
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background-color: rgba(255,255,255,0.15) !important;
}

/* Dropdown del usuario - Mejorado */
.navbar-nav > .user-menu > .dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border: none;
    margin-top: 5px;
    min-width: 280px;
}

.navbar-nav > .user-menu > .dropdown-menu > .user-body {
    padding: 20px;
    border-bottom: none;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Imagen de usuario mejorada */
.user-image {
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.dropdown-toggle:hover .user-image {
    transform: scale(1.05);
    border-color: #fff;
}

/* Información del usuario en el header */
.navbar-nav > .user-menu > a > span {
    display: inline-block;
    transition: all 0.3s ease;
}

.navbar-nav > .user-menu > a:hover > span {
    color: #fff !important;
}

.navbar-nav > .user-menu > a small {
    opacity: 0.85;
    font-size: 11px !important;
    margin-top: 2px;
    font-weight: 400;
}

/* Botón de salir mejorado */
.user-body .btn-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.user-body .btn-default:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.user-body .btn-default:active {
    transform: translateY(0);
}

/* Icono en el dropdown */
.user-menu .dropdown-toggle::after {
    display: none;
}

/* ===================================
   MODALES - DISEÑO MODERNO
   =================================== */

/* Backdrop mejorado */
.modal-backdrop.in {
    opacity: 0.6;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.3) 100%);
}

/* Contenedor del modal */
.modal-dialog {
    margin-top: 60px;
    transition: all 0.3s ease;
}

.modal.fade .modal-dialog {
    transform: scale(0.9);
    opacity: 0;
}

.modal.in .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

/* Contenido del modal */
.modal-content {
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: none;
    overflow: hidden;
}

/* Header del modal - Diseño moderno con gradiente */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    padding: 25px 30px !important;
    border-bottom: none !important;
    position: relative;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.modal-title {
    font-weight: 700 !important;
    font-size: 24px !important;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Botón de cerrar mejorado */
.modal-header .close {
    color: white !important;
    opacity: 0.9 !important;
    font-size: 32px !important;
    font-weight: 300 !important;
    text-shadow: none !important;
    transition: all 0.3s ease;
}

.modal-header .close:hover {
    opacity: 1 !important;
    transform: rotate(90deg);
}

/* Cuerpo del modal */
.modal-body {
    padding: 30px !important;
    background: #fff;
}

.modal-body .box-body {
    padding: 0;
}

/* Grupos de formulario en modales */
.modal-body .form-group {
    margin-bottom: 25px;
}

.modal-body .input-group {
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.modal-body .input-group:focus-within {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

/* Iconos de input mejorados */
.modal-body .input-group-addon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 18px;
    padding: 12px 15px;
}

/* Inputs mejorados */
.modal-body .form-control {
    border: 2px solid #e8e8e8;
    border-left: none;
    font-size: 15px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.modal-body .form-control:focus {
    border-color: #667eea;
    box-shadow: none;
}

/* Select mejorado */
.modal-body select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-color: #fff;
    padding-right: 40px;
    color: #333 !important;
}

/* Fix para selects dentro de input-group (productos, usuarios) */
.modal-body .input-group select.form-control,
.modal-body .input-group select.form-control.input-lg {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-color: #fff !important;
    padding-right: 40px;
    color: #333 !important;
    height: auto;
    line-height: 1.5;
}

/* Asegurar que las opciones del select sean visibles */
.modal-body select.form-control option {
    color: #333 !important;
    background-color: #fff !important;
    padding: 10px;
}

/* Placeholder del select (opción vacía) */
.modal-body select.form-control option[value=""] {
    color: #999 !important;
}

/* Footer del modal */
.modal-footer {
    padding: 20px 30px !important;
    border-top: 1px solid #f0f0f0 !important;
    background: #fafafa;
}

/* Botones en modales */
.modal-footer .btn,
.modal-body .btn {
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

/* Botón primario (Guardar) */
.modal-footer .btn-primary,
.modal-body .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modal-footer .btn-primary:hover,
.modal-body .btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Botón default (Cancelar) */
.modal-footer .btn-default,
.modal-body .btn-default.cancelar {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.modal-footer .btn-default:hover,
.modal-body .btn-default.cancelar:hover {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

/* Botón de peligro (Eliminar) */
.modal-footer .btn-danger,
.modal-body .btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.modal-footer .btn-danger:hover,
.modal-body .btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Botón success */
.modal-footer .btn-success,
.modal-body .btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.modal-footer .btn-success:hover,
.modal-body .btn-success:hover {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

/* Estado activo de botones */
.modal-footer .btn:active,
.modal-body .btn:active {
    transform: translateY(0) !important;
}

/* ===================================
   MODALES ESPECIALES
   =================================== */

/* Modal de confirmación */
.modal-content.swal2-modal {
    border-radius: 20px;
}

/* Checkbox y Radio mejorados */
.modal-body .icheckbox_square-blue,
.modal-body .iradio_square-blue {
    margin-right: 10px;
}

/* Tablas dentro de modales */
.modal-body table {
    margin-bottom: 0;
}

.modal-body .table > thead > tr > th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Upload de archivos mejorado */
.modal-body input[type="file"] {
    padding: 10px;
    border: 2px dashed #667eea;
    border-radius: 10px;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-body input[type="file"]:hover {
    border-color: #764ba2;
    background: #f0f2ff;
}

/* Preview de imágenes */
.modal-body img.previsualizarImg {
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.modal-body img.previsualizarImg:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .modal-dialog {
        margin: 20px;
    }
    
    .modal-header {
        padding: 20px !important;
    }
    
    .modal-title {
        font-size: 20px !important;
    }
    
    .modal-body {
        padding: 20px !important;
    }
    
    .modal-footer {
        padding: 15px 20px !important;
    }
    
    .navbar-nav > .user-menu > .dropdown-menu {
        min-width: 240px;
    }
}

/* ===================================
   ANIMACIONES
   =================================== */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal.in .modal-dialog {
    animation: slideInDown 0.3s ease-out;
}

/* Efecto de pulso en hover */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.btn-primary:focus {
    animation: pulse 1s infinite;
}
