/* 
 * Estilos CSS para el frontend del plugin Video Speaker Manager
 * Archivo: assets/frontend.css
 */

/* Variables CSS */
:root {
    --primary-blue: #003d99;
    --light-blue: #4a90e2;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark-gray: #666666;
    --text-dark: #333333;
    --border-light: #e1e5e9;
    --shadow: 0 4px 20px rgba(0, 61, 153, 0.1);
    --transition: all 0.3s ease;
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.speaker-page {
    font-family: 'Open Sans', 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sección Hero del Speaker */
.speaker-hero {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    color: var(--white);
    padding: 80px 0 120px;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.speaker-intro {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.speaker-image {
    display: flex;
    justify-content: center;
}

.speaker-photo {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.speaker-photo:hover {
    transform: scale(1.05);
}

.speaker-name {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.speaker-title {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.speaker-bio {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 40px;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    background: var(--white);
    color: var(--primary-blue);
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: var(--transition);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    color: var(--primary-blue);
}

/* Curva decorativa */
.hero-curve {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--white);
    clip-path: ellipse(100% 100% at 50% 100%);
}

/* Sección de Videos */
.videos-section {
    padding: 100px 0;
    background: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--dark-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* Buscador */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.search-box {
    position: relative;
    max-width: 500px;
    width: 100%;
}

#video-search {
    width: 100%;
    padding: 18px 60px 18px 25px;
    border: 2px solid var(--border-light);
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background: var(--light-gray);
}

#video-search:focus {
    border-color: var(--primary-blue);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 61, 153, 0.1);
}

#search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-blue);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

#search-btn:hover {
    background: var(--light-blue);
    transform: translateY(-50%) scale(1.1);
}

/* Grid de Videos */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.video-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-light);
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 61, 153, 0.15);
}

.video-thumbnail {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.1);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 61, 153, 0.9);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.video-card:hover .play-overlay {
    background: rgba(0, 61, 153, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-info {
    padding: 25px;
}

.video-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 12px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-excerpt {
    color: var(--dark-gray);
    margin-bottom: 15px;
    line-height: 1.6;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-date {
    font-size: 0.9rem;
    color: var(--dark-gray);
    font-weight: 500;
}

/* Modal de Video */
.video-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--white);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

#modal-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-info {
    padding: 30px;
    background: var(--light-gray);
}

#modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#modal-description {
    color: var(--dark-gray);
    line-height: 1.6;
}

/* Paginación */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 12px 20px;
    border: 2px solid var(--primary-blue);
    background: var(--white);
    color: var(--primary-blue);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 60px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    color: var(--dark-gray);
    font-weight: 500;
}

/* Estado vacío */
.no-videos {
    text-align: center;
    padding: 60px 20px;
    color: var(--dark-gray);
}

.no-videos p {
    font-size: 1.2rem;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-card {
    animation: fadeInUp 0.6s ease forwards;
}

.video-card:nth-child(1) { animation-delay: 0.1s; }
.video-card:nth-child(2) { animation-delay: 0.2s; }
.video-card:nth-child(3) { animation-delay: 0.3s; }
.video-card:nth-child(4) { animation-delay: 0.4s; }
.video-card:nth-child(5) { animation-delay: 0.5s; }
.video-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .speaker-hero {
        padding: 60px 0 80px;
    }

    .speaker-intro {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .speaker-photo {
        width: 220px;
        height: 220px;
    }

    .speaker-name {
        font-size: 2.5rem;
    }

    .speaker-title {
        font-size: 1.1rem;
    }

    .speaker-bio {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .videos-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .video-card {
        margin: 0 10px;
    }

    .search-box {
        margin: 0 15px;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-info {
        padding: 20px;
    }

    .close-modal {
        top: 10px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 25px;
    }
}

@media (max-width: 480px) {
    .speaker-name {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .video-info {
        padding: 20px;
    }

    .video-title {
        font-size: 1.1rem;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
}

/* Estados hover mejorados */
@media (hover: hover) {
    .video-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, transparent 30%, rgba(0, 61, 153, 0.05) 100%);
        opacity: 0;
        transition: var(--transition);
        pointer-events: none;
        z-index: 1;
    }

    .video-card:hover::before {
        opacity: 1;
    }
}

/* Mejoras de accesibilidad */
.video-card:focus,
.cta-button:focus,
#search-btn:focus,
.pagination-btn:focus {
    outline: 3px solid rgba(0, 61, 153, 0.3);
    outline-offset: 2px;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Personalización de scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--light-blue);
}