/* Estilos específicos del frontend público */

.convencion-formulario-registro {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #0B1F35; /* Color para todos los textos del formulario */
}

.convencion-formulario-registro h2 {
    color: #0B1F35;
}

.convencion-formulario-registro p {
    color: #0B1F35;
}

.convencion-field {
    margin-bottom: 15px;
}

.convencion-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #0B1F35;
}

.convencion-field .required {
    color: red;
}

.convencion-field input[type="text"],
.convencion-field input[type="tel"],
.convencion-field input[type="email"],
.convencion-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    color: #0B1F35;
}

.convencion-field input::placeholder,
.convencion-field select option {
    color: #0B1F35;
    opacity: 0.7;
}

.convencion-field small {
    color: #0B1F35;
    opacity: 0.8;
}

/* Estilos para botones de horarios */
.convencion-horarios-botones {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.convencion-btn-horario {
    background: #fff;
    color: #0B1F35;
    border: 2px solid #0B1F35;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    width: calc(25% - 8px); /* Cuatro botones por fila por defecto en PC */
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

.convencion-btn-horario:hover {
    background: #0B1F35;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(11, 31, 53, 0.2);
}

.convencion-btn-horario.selected {
    background: #0B1F35;
    color: #fff;
    border-color: #0B1F35;
    font-weight: bold;
}

.convencion-btn-horario:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
    color: #999;
    border-color: #ddd;
}

.convencion-btn-horario.no-disponible {
    opacity: 0.4;
    background: #ffebee;
    color: #c62828;
    border-color: #c62828;
    position: relative;
}

.convencion-btn-horario.no-disponible::after {
    content: '✕';
    position: absolute;
    top: 2px;
    right: 5px;
    font-size: 12px;
    color: #c62828;
}

.convencion-btn-horario.loading {
    opacity: 0.6;
    cursor: wait;
    position: relative;
}

.convencion-btn-horario.loading::after {
    content: '⏳';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

/* Estilos para lista de emparejamientos */
.convencion-emparejamientos-lista {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.convencion-emparejamiento-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #0B1F35;
}

.convencion-emparejamiento-item:last-child {
    margin-bottom: 0;
}

.convencion-emparejamiento-info {
    flex: 1;
}

.convencion-emparejamiento-expositor {
    font-weight: bold;
    color: #0B1F35;
    margin-bottom: 3px;
}

.convencion-emparejamiento-horario {
    font-size: 13px;
    color: #0B1F35;
    opacity: 0.8;
}

.convencion-emparejamiento-eliminar {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    transition: background 0.3s ease;
}

.convencion-emparejamiento-eliminar:hover {
    background: #c82333;
}

.convencion-submit {
    margin-top: 20px;
}

.convencion-submit button {
    background: #0B1F35;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.convencion-submit button:hover:not(:disabled) {
    background: #0a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(11, 31, 53, 0.3);
}

/* Estado de loading del botón */
.convencion-submit button:disabled,
.convencion-submit button.convencion-btn-loading {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    position: relative;
}

/* Spinner animado */
.convencion-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: convencion-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes convencion-spin {
    to { transform: rotate(360deg); }
}

.convencion-mensaje {
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

.convencion-mensaje.convencion-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.convencion-mensaje.convencion-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media only screen and (max-width: 600px) {
    .convencion-formulario-registro {
        padding: 15px;
        margin: 10px;
    }
    
    .convencion-horarios-botones {
        gap: 8px;
    }
    
    .convencion-btn-horario {
        width: calc(50% - 5px);
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .convencion-emparejamiento-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .convencion-emparejamiento-eliminar {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
}

/* Pantallas muy pequeñas (menos de 375px) - dos botones por fila, ancho completo */
@media only screen and (max-width: 375px) {
    .convencion-formulario-registro {
        padding: 12px;
        margin: 5px;
    }
    
    .convencion-horarios-botones {
        gap: 6px;
        width: 100%;
    }
    
    .convencion-btn-horario {
        width: calc(50% - 3px); /* Dos botones por fila con gap reducido */
        flex: 0 0 calc(50% - 3px); /* Evita que se expanda */
        min-width: 0; /* Permite que se ajuste al contenedor */
        padding: 10px 6px; /* Padding reducido para pantallas pequeñas */
        font-size: 12px; /* Tamaño de fuente reducido */
        box-sizing: border-box;
    }
}

/* Estados de loading para botón de registro (mismo estilo que admin) */
.convencion-submit button[disabled],
.convencion-submit button.loading {
    opacity: 0.8 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: #999 !important;
    color: #fff !important;
    border-color: #888 !important;
}

/* Spinner animado para botón de registro (mismo que admin) */
.convencion-submit-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: convencion-submit-spin 1s ease-in-out infinite;
    margin-right: 5px;
}

@keyframes convencion-submit-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pantallas de PC/escritorio - cuatro botones por fila */
@media only screen and (min-width: 768px) {
    .convencion-formulario-registro {
        max-width: 900px; /* Ancho más amplio para PC */
    }
    
    .convencion-horarios-botones {
        gap: 10px;
    }
    
    .convencion-btn-horario {
        width: calc(25% - 8px); /* Cuatro botones por fila */
        flex: 0 0 calc(25% - 8px);
        padding: 10px 15px;
        font-size: 14px;
        min-width: 0; /* Permite que se ajuste */
    }
}

/* Pantallas medianas (tablets) - tres botones por fila */
@media only screen and (min-width: 600px) and (max-width: 767px) {
    .convencion-btn-horario {
        width: calc(33.333% - 7px); /* Tres botones por fila */
        flex: 0 0 calc(33.333% - 7px);
    }
}

/* Estilos para el modal de éxito */
.convencion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.convencion-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.convencion-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    animation: convencion-modal-fade-in 0.3s ease-out;
}

@keyframes convencion-modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.convencion-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0B1F35;
    border-radius: 8px 8px 0 0;
}

.convencion-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
}

.convencion-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.convencion-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.convencion-modal-body {
    padding: 30px 25px;
    text-align: center;
}

.convencion-modal-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.convencion-modal-body p {
    color: #0B1F35;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.convencion-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.convencion-modal-btn {
    background: #0B1F35;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 120px;
}

.convencion-modal-btn:hover {
    background: #0a1a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(11, 31, 53, 0.3);
}

.convencion-modal-btn:active {
    transform: translateY(0);
}

/* Responsive para el modal */
@media only screen and (max-width: 600px) {
    .convencion-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .convencion-modal-header {
        padding: 15px 20px;
    }
    
    .convencion-modal-header h3 {
        font-size: 18px;
    }
    
    .convencion-modal-body {
        padding: 25px 20px;
    }
    
    .convencion-modal-body p {
        font-size: 15px;
    }
    
    .convencion-modal-footer {
        padding: 15px 20px;
    }
    
    .convencion-modal-btn {
        width: 100%;
        padding: 12px 20px;
    }
}

/* Estilos para el Toast de notificación */
.convencion-toast {
    margin-top: 20px;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: convencion-toast-slide-in 0.3s ease-out;
    overflow: hidden;
}

@keyframes convencion-toast-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.convencion-toast-content {
    background: #d4edda;
    border: 2px solid #155724;
    border-left: 5px solid #155724;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #155724;
    font-weight: 500;
}

.convencion-toast-icon {
    background: #155724;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.convencion-toast-mensaje {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
}

.convencion-toast-cerrar {
    background: #155724;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.convencion-toast-cerrar:hover {
    background: #0d3d1a;
}

.convencion-toast-cerrar:active {
    transform: scale(0.98);
}

/* Responsive para el toast */
@media only screen and (max-width: 600px) {
    .convencion-toast-content {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .convencion-toast-icon {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
    
    .convencion-toast-mensaje {
        font-size: 14px;
    }
    
    .convencion-toast-cerrar {
        width: 100%;
        padding: 10px 20px;
        font-size: 15px;
    }
}
