/* ========================================================================
   COMPONENTES AUXILIARES PARA SISTEMA MODAL - EDICTOS v2.0
   ======================================================================== */

/* ========================================
   SPINNERS DE CARGA
   ======================================== */

/* Spinner básico para modales de carga */
.loading-spinner-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.loading-spinner-modal .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: edictos-spin 1s linear infinite;
}

.loading-spinner-modal p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #64748b;
    text-align: center;
}

/* Spinner pequeño para inline */
.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #f1f5f9;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: edictos-spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Animación del spinner */
@keyframes edictos-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   ICONOS PARA MODALES
   ======================================== */

/* Contenedor de iconos */
.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

/* Iconos por tipo */
.modal-icon.success {
    background: #dcfce7;
    color: #22c55e;
}

.modal-icon.error {
    background: #fef2f2;
    color: #ef4444;
}

.modal-icon.warning {
    background: #fef3c7;
    color: #f59e0b;
}

.modal-icon.info {
    background: #dbeafe;
    color: #3b82f6;
}

.modal-icon.question {
    background: #f3f4f6;
    color: #6b7280;
}

/* Contenido de iconos usando símbolos Unicode */
.modal-icon.success::before { content: "✓"; }
.modal-icon.error::before { content: "✕"; }
.modal-icon.warning::before { content: "⚠"; }
.modal-icon.info::before { content: "ℹ"; }
.modal-icon.question::before { content: "?"; }

/* ========================================
   BOTONES PERSONALIZADOS PARA MODALES
   ======================================== */

/* Botones base */
.edictos-modal-btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}

.edictos-modal-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Variantes de botones */
.edictos-modal-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.edictos-modal-btn.primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.edictos-modal-btn.secondary {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}

.edictos-modal-btn.secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.edictos-modal-btn.danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.edictos-modal-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.edictos-modal-btn.success {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

.edictos-modal-btn.success:hover {
    background: #16a34a;
    border-color: #16a34a;
}

.edictos-modal-btn.outline {
    background: transparent;
    color: #3b82f6;
    border-color: #3b82f6;
}

.edictos-modal-btn.outline:hover {
    background: #3b82f6;
    color: white;
}

/* Botón con spinner */
.edictos-modal-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.edictos-modal-btn.loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: edictos-spin 0.8s linear infinite;
    margin-right: 6px;
}

/* ========================================
   FORMULARIOS EN MODALES
   ======================================== */

/* Grupos de formulario optimizados para modales */
.edictos-modal-form-group {
    margin-bottom: 20px;
}

.edictos-modal-form-group:last-child {
    margin-bottom: 0;
}

.edictos-modal-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.edictos-modal-form-group label.required::after {
    content: " *";
    color: #ef4444;
}

/* Inputs optimizados */
.edictos-modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.edictos-modal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edictos-modal-input.error {
    border-color: #ef4444;
}

.edictos-modal-input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Textarea */
.edictos-modal-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Select */
.edictos-modal-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Mensajes de error */
.edictos-modal-error-message {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    display: block;
}

/* ========================================
   LAYOUTS ESPECÍFICOS
   ======================================== */

/* Layout de dos columnas */
.edictos-modal-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .edictos-modal-two-columns {
        grid-template-columns: 1fr;
    }
}

/* Layout de tres columnas */
.edictos-modal-three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .edictos-modal-three-columns {
        grid-template-columns: 1fr;
    }
}

/* Separadores */
.edictos-modal-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 20px 0;
}

.edictos-modal-divider.thick {
    height: 2px;
    background: #d1d5db;
}

/* ========================================
   ALERTAS Y NOTIFICACIONES EN MODALES
   ======================================== */

.edictos-modal-alert {
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.edictos-modal-alert.info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.edictos-modal-alert.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.edictos-modal-alert.warning {
    background: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

.edictos-modal-alert.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

/* ========================================
   UTILIDADES ADICIONALES
   ======================================== */

/* Texto centrado */
.edictos-modal-text-center {
    text-align: center;
}

/* Espaciado adicional */
.edictos-modal-spacer {
    height: 20px;
}

.edictos-modal-spacer.large {
    height: 32px;
}

/* Lista de elementos */
.edictos-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.edictos-modal-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.edictos-modal-list li:last-child {
    border-bottom: none;
}

/* Progress bar */
.edictos-modal-progress {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.edictos-modal-progress-bar {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Tabs en modales */
.edictos-modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.edictos-modal-tab {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.2s ease;
}

.edictos-modal-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.edictos-modal-tab:hover {
    color: #374151;
}

.edictos-modal-tab-content {
    display: none;
}

.edictos-modal-tab-content.active {
    display: block;
}
