/*=============================================
ESTILOS ESPECÍFICOS PARA MODALES DE PLANTILLAS
NOTA: Estilos encapsulados para NO afectar otros módulos
=============================================*/

/* Encapsular todos los estilos con .modulo-plantillas */

/* Modal mejorado */
.modal-lg {
    max-width: 95%;
    width: 1200px;
}

#modalAgregarPlantilla .modal-content,
#modalEditarPlantilla .modal-content {
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Header del modal */
#modalAgregarPlantilla .modal-header,
#modalEditarPlantilla .modal-header {
    border-radius: 10px 10px 0 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-bottom: 3px solid #5a67d8;
}

#modalAgregarPlantilla .modal-title,
#modalEditarPlantilla .modal-title {
    font-weight: bold;
    font-size: 22px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Secciones del formulario - SOLO PARA PLANTILLAS */
#modalAgregarPlantilla .panel,
#modalEditarPlantilla .panel,
.modulo-plantillas .panel {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

#modalAgregarPlantilla .panel:hover,
#modalEditarPlantilla .panel:hover,
.modulo-plantillas .panel:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

#modalAgregarPlantilla .panel-heading,
#modalEditarPlantilla .panel-heading,
.modulo-plantillas .panel-heading {
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white !important;
    font-weight: bold;
}

#modalAgregarPlantilla .panel-heading h5,
#modalEditarPlantilla .panel-heading h5,
.modulo-plantillas .panel-heading h5 {
    margin: 5px 0;
    color: white !important;
    font-size: 16px;
}

#modalAgregarPlantilla .panel-default > .panel-heading,
#modalEditarPlantilla .panel-default > .panel-heading,
.modulo-plantillas .panel-default > .panel-heading {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

#modalAgregarPlantilla .panel-info > .panel-heading,
#modalEditarPlantilla .panel-info > .panel-heading,
.modulo-plantillas .panel-info > .panel-heading {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

#modalAgregarPlantilla .panel-success > .panel-heading,
#modalEditarPlantilla .panel-success > .panel-heading,
.modulo-plantillas .panel-success > .panel-heading {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Campos de entrada - SOLO PARA PLANTILLAS */
#modalAgregarPlantilla .form-control,
#modalEditarPlantilla .form-control,
.modulo-plantillas .form-control {
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

#modalAgregarPlantilla .form-control:focus,
#modalEditarPlantilla .form-control:focus,
.modulo-plantillas .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Color pickers */
input[type="color"] {
    cursor: pointer;
    border-radius: 8px !important;
    border: 3px solid #ddd !important;
}

input[type="color"]:hover {
    border-color: #667eea !important;
}

/* Campos readonly */
input[readonly] {
    background-color: #f8f9fa !important;
    font-weight: bold;
    text-align: center;
    color: #495057;
}

/* Sliders de transparencia */
input[type="range"] {
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Labels mejorados - SOLO PARA PLANTILLAS */
#modalAgregarPlantilla label,
#modalEditarPlantilla label,
.modulo-plantillas label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

/* Small text */
.text-muted {
    font-size: 12px;
    font-style: italic;
    color: #6c757d !important;
}

/* Botones del modal */
#modalAgregarPlantilla .modal-footer,
#modalEditarPlantilla .modal-footer {
    border-top: 2px solid #e9ecef;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

#modalAgregarPlantilla .btn-primary,
#modalEditarPlantilla .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 10px 30px;
    font-weight: bold;
    border-radius: 25px;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

#modalAgregarPlantilla .btn-primary:hover,
#modalEditarPlantilla .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

/* Separadores de secciones */
.box-body h4 {
    color: #495057;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

/* Iconos en los títulos */
.panel-heading i {
    margin-right: 8px;
    font-size: 18px;
}

/* Rows con mejor espaciado */
.panel-body .row {
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 992px) {
    .modal-lg {
        max-width: 95%;
        width: 95%;
    }
    
    .col-md-6 {
        margin-bottom: 20px;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal.fade .modal-dialog {
    animation: fadeIn 0.3s ease;
}

/* Tooltips mejorados - SOLO PARA PLANTILLAS */
#modalAgregarPlantilla .form-group,
#modalEditarPlantilla .form-group,
.modulo-plantillas .form-group {
    position: relative;
}

/* Inputs con iconos - SOLO PARA PLANTILLAS */
#modalAgregarPlantilla .input-group-addon,
#modalEditarPlantilla .input-group-addon,
.modulo-plantillas .input-group-addon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: bold;
}

/* Campos de número mejorados - SOLO PARA PLANTILLAS */
#modalAgregarPlantilla input[type="number"],
#modalEditarPlantilla input[type="number"],
.modulo-plantillas input[type="number"] {
    text-align: center;
    font-weight: 600;
}

/* Select mejorado - SOLO PARA PLANTILLAS */
#modalAgregarPlantilla select.form-control,
#modalEditarPlantilla select.form-control,
.modulo-plantillas select.form-control {
    cursor: pointer;
    font-weight: 600;
}

#modalAgregarPlantilla select.form-control:focus,
#modalEditarPlantilla select.form-control:focus,
.modulo-plantillas select.form-control:focus {
    border-color: #667eea;
}

/* File input mejorado */
input[type="file"] {
    padding: 10px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
}

input[type="file"]:hover {
    background: #e9ecef;
    border-color: #764ba2;
}

/* Botón Salir mejorado */
.btn-default {
    border-radius: 25px;
    padding: 10px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-default:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
}

