/**
 * Estilos para el Calendario de Eventos Future OFinder - Versión Compacta
 */

/* Contenedor principal */
.fo-calendar-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.5rem;
    position: relative;
}

/* Helper Button - DENTRO DE CADA EVENTO */
.fo-helper-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    border: none;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
    opacity: 0.5;
}

.fo-helper-button:hover {
    background: #495057;
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.3);
    opacity: 0.8;
}

/* Modal */
.fo-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.fo-modal-overlay.fo-modal-active {
    display: flex;
}

.fo-modal {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fo-modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fo-modal-title {
    margin: 0;
    color: #032e7d;
    font-size: 1.4rem;
    font-weight: 700;
}

.fo-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.fo-modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.fo-modal-body {
    padding: 1.5rem;
}

.fo-modal-content {
    line-height: 1.6;
    color: #495057;
}

.fo-modal-content p {
    margin-bottom: 1rem;
}

.fo-modal-content strong {
    color: #032e7d;
}

.fo-modal-content .fo-contact-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.fo-modal-content .fo-contact-email {
    color: #032e7d;
    font-weight: 600;
    text-decoration: none;
}

.fo-modal-content .fo-contact-email:hover {
    text-decoration: underline;
}

.fo-modal-content .fo-beta-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    color: #856404;
}

.fo-modal-content .fo-beta-warning strong {
    color: #856404;
}

/* Modal de Apellidos */
.fo-surname-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.fo-surname-modal-overlay.fo-modal-active {
    display: flex;
}

.fo-surname-modal {
    background: white;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

.fo-surname-modal-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.fo-surname-modal-title {
    margin: 0;
    color: #032e7d;
    font-size: 1.7rem;
    font-weight: 700;
}

.fo-surname-modal-body {
    padding: 2rem 1.5rem;
}

.fo-surname-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.fo-surname-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fo-surname-field label {
    font-weight: 600;
    color: #495057;
    font-size: 1.3rem;
}

.fo-surname-field input {
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1.3rem;
    transition: border-color 0.2s ease;
}

.fo-surname-field input:focus {
    outline: none;
    border-color: #032e7d;
    box-shadow: 0 0 0 3px rgba(3, 46, 125, 0.1);
}

.fo-surname-field input[readonly] {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    cursor: not-allowed !important;
    border-color: #dee2e6 !important;
}

.fo-surname-field input[readonly]:focus {
    border-color: #dee2e6 !important;
    box-shadow: none !important;
}

.fo-surname-field input[readonly]::placeholder {
    color: #adb5bd !important;
}

.fo-surname-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.fo-surname-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.fo-surname-btn-primary {
    background: #032e7d;
    color: white;
}

.fo-surname-btn-primary:hover {
    background: #001f57;
    transform: translateY(-1px);
}

.fo-surname-btn-secondary {
    background: #6c757d;
    color: white;
}

.fo-surname-btn-secondary:hover {
    background: #495057;
}

.fo-surname-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #1565c0;
    font-size: 1.2rem;
    line-height: 1.4;
}

.fo-calendar-empty {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-style: italic;
}

/* Paginación - ESTILO COMO EN LA IMAGEN */
.fo-calendar-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
}

.fo-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fo-page-btn {
    display: flex;
    align-items: center;   
    gap: 0.4rem;
    background: #f8f9fa;
    color: #6c757d !important;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.fo-page-btn:hover {
    background: #e9ecef;
    color: #495057 !important;
    border-color: #adb5bd;
}

.fo-page-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.fo-page-numbers {
    display: flex;
    gap: 0.25rem;
}

.fo-page-number {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 5px;
    border-radius: 9999px;
    background-color: #f1f1f1;
    color: #032e7d;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s ease;
}

.fo-page-number:hover {
    background-color: #e0e0e0;
    color: #032e7d !important;
}

.fo-page-number.fo-page-current {
    background-color: #032e7d;
    color: #fff !important;
}

/* Contenedor de eventos */
.fo-calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Evento individual - ESTRUCTURA MEJORADA */
.fo-calendar-event {
    background: #ffffff !important;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    overflow: visible; /* Cambiar de hidden a visible para que el badge no se corte */
}

.fo-calendar-event:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Header del evento - Título y contador en la misma línea */
.fo-event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1rem;
}

.fo-event-info {
    flex: 1;
    min-width: 0; /* Para permitir text overflow */
}

.fo-event-title {
    color: #032e7d;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.8rem 0;
    line-height: 1.3;
    word-wrap: break-word;
}

.fo-event-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    font-size: 1rem;
    color: #5a6c7d;
}

.fo-event-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    flex: 1;
}

.fo-event-date,
.fo-event-convocatoria {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    white-space: nowrap;
}

.fo-event-date .dashicons,
.fo-event-convocatoria .dashicons {
    color: #032e7d;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Estados del evento - FONDO BLANCO CON BORDES DISTINTIVOS */
.fo-event-past {
    background: #ffffff !important;
    opacity: 0.8;
    border-left: 4px solid #6c757d;
}

.fo-event-soon {
    background: #ffffff !important;
    border-left: 4px solid #ff6b35;
    border-color: #ff6b35;
}

.fo-event-future {
    background: #ffffff !important;
    border-left: 4px solid #032e7d;
}

.fo-event-active {
    background: #ffffff !important;
    border-left: 4px solid #28a745;
    border-color: #28a745;
}

.fo-event-subscription-required {
    background: #fff8e1 !important;
    border-left: 4px solid #ff9800;
    border-color: #ff9800;
    opacity: 0.9;
}

/* Badge de estado - COMPLETAMENTE POR ENCIMA */
.fo-event-badge {
    position: absolute;
    top: -12px;
    right: 1.5rem;
    background: #032e7d;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(3, 46, 125, 0.3);
    z-index: 1000; /* Z-index muy alto para estar por encima de todo */
}

.fo-event-soon .fo-event-badge {
    background: #ff6b35;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.3);
}

.fo-event-active .fo-event-badge {
    background: #28a745;
    box-shadow: 0 3px 8px rgba(40, 167, 69, 0.3);
    animation: pulse 2s infinite;
}

.fo-event-past .fo-event-badge {
    background: #6c757d;
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.3);
}

.fo-event-subscription-required .fo-event-badge {
    background: #ff9800;
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.3);
    color: white;
}

/* Aviso de suscripción requerida */
.fo-event-subscription-notice {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1rem;
    padding: 0.8rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.fo-subscription-icon .dashicons {
    color: #ff9800;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.fo-subscription-text {
    flex: 1;
}

.fo-subscription-text strong {
    color: #ff9800;
    display: block;
    margin-bottom: 0.2rem;
}

.fo-subscription-text p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Cursos relacionados - TEXTOS MÁS GRANDES */
.fo-event-courses {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.8rem;
    margin-top: 0.6rem;
}

.fo-event-courses strong {
    color: #032e7d;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fo-course-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fo-course-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #032e7d;
    color: white !important;
    padding: 0.4rem 0.8rem;
    border-radius: 14px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.fo-course-link:hover {
    background: #001f57;
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(3, 46, 125, 0.3);
}

.fo-course-link .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Cuenta regresiva - SIN FONDO, A LA DERECHA DE LOS METADATOS */
.fo-event-countdown {
    /*border: 2px solid #032e7d;*/
    border-radius: 12px;
    /*padding: 0.6rem 1rem;*/
    background: transparent;
    flex-shrink: 0;
    align-self: flex-start;
}

.fo-countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    text-align: center;
}

.fo-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    transition: all 0.2s ease;
    min-width: 45px;
}

.fo-countdown-item:hover {
    background: #e9ecef;
    transform: scale(1.02);
}

.fo-countdown-number {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #032e7d;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.fo-countdown-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive - ADAPTADO AL NUEVO DISEÑO */
@media (max-width: 768px) {
    .fo-calendar-container {
        padding: 0.5rem;
    }
    
    .fo-calendar-event {
        padding: 1.2rem;
        margin-bottom: 1.2rem;
    }
    
    .fo-event-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .fo-event-title {
        font-size: 1.3rem;
        margin-bottom: 0.6rem;
    }
    
    .fo-event-meta {
        flex-direction: column;
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .fo-event-meta-info {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .fo-event-countdown {
        min-width: auto;
        align-self: stretch;
        order: -1; /* Mover el countdown arriba en móviles */
        padding: 0.5rem 0.8rem;
    }
    
    .fo-countdown {
        flex-wrap: wrap;
        gap: 0.6rem;
        justify-content: center;
    }
    
    .fo-countdown-item {
        padding: 0.3rem 0.5rem;
        min-width: 40px;
    }
    
    .fo-countdown-number {
        font-size: 1rem;
    }
    
    .fo-countdown-label {
        font-size: 0.55rem;
    }
    
    .fo-event-badge {
        right: 1rem;
        padding: 0.3rem 0.8rem;
        font-size: 0.75rem;
        top: -10px;
    }
    
    .fo-course-links {
        flex-direction: column;
    }
    
    .fo-course-link {
        justify-content: center;
        font-size: 0.8rem;
    }
    
    .fo-pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .fo-page-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .fo-page-number {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* Estados adicionales para mejor UX */
.fo-calendar-event.fo-event-active .fo-event-title {
    color: #28a745;
}

.fo-calendar-event.fo-event-soon .fo-event-title {
    color: #ff6b35;
}

.fo-calendar-event.fo-event-past .fo-event-title {
    color: #6c757d;
}

/* Efectos de hover mejorados */
.fo-calendar-event:hover .fo-event-badge {
    transform: scale(1.05);
}

.fo-calendar-event:hover .fo-course-link {
    transform: translateY(-1px);
}

/* Animación de carga */
.fo-calendar-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fo-calendar-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #032e7d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos responsivos para el modal */
@media (max-width: 768px) {
    .fo-helper-button {
        width: 18px;
        height: 18px;
        font-size: 9px;
        bottom: 12px;
        right: 12px;
    }
    
    .fo-helper-button:hover {
        transform: scale(1.1);
    }
    
    .fo-modal {
        width: 95%;
        margin: 1rem;
        max-height: 90vh;
    }
    
    .fo-modal-header {
        padding: 1rem;
    }
    
    .fo-modal-title {
        font-size: 1.2rem;
    }
    
    .fo-modal-body {
        padding: 1rem;
    }
    
    .fo-modal-content {
        font-size: 0.9rem;
    }
    
    .fo-modal-content .fo-contact-info,
    .fo-modal-content .fo-beta-warning {
        padding: 0.8rem;
        margin: 0.8rem 0;
    }
    
    /* Estilos responsivos para modal de apellidos */
    .fo-surname-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .fo-surname-modal-header {
        padding: 1rem;
    }
    
    .fo-surname-modal-title {
        font-size: 1.5rem;
    }
    
    .fo-surname-modal-body {
        padding: 1.5rem 1rem;
    }
    
    .fo-surname-field label {
        font-size: 1.2rem;
    }
    
    .fo-surname-field input {
        font-size: 1.2rem;
        padding: 0.8rem;
    }
    
    .fo-surname-info {
        font-size: 1.1rem;
    }
    
    .fo-surname-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .fo-surname-btn {
        width: 100%;
        text-align: center;
        font-size: 1.1rem;
    }
}
