:root {
    --modal-primary-color: #1a3a5f;
    --modal-secondary-color: #d4af37;
    --modal-background-color: #f4f7f6;
    --modal-text-color: #333;
    --modal-card-bg: #ffffff;
    --modal-border-color: #e0e0e0;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    direction: rtl;
}

/* Bloquear scroll de la web principal cuando haya un modal abierto */
html.modal-open,
body.modal-open {
    overflow: hidden;
}

/* Modal a pantalla completa con su propio scroll */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 20px;
    display: none;
}

/* Clase para mostrar el modal cuando se active desde JS */
.modal-container.is-open {
    display: block;
}

/* Contenido interno centrado y con ancho máximo */
.modal-container > header,
.modal-container > .cv-section {
    max-width: 1000px;
    margin: 0 auto 30px;
}

.cv-modal-close {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Modal de vídeo a pantalla completa (index.html y sabio.html) */
.video-player-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2000;
}

.video-player-content {
    background: #000;
    border-radius: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.video-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.video-player {
    width: 100%;
    height: 100%;
    background: #000;
}

.video-player video,
.video-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 640px) {
    .video-player-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .video-player-header {
        padding: 0.5rem 0.75rem;
    }

    .video-title {
        font-size: 0.9rem;
    }
}

header {
    background: linear-gradient(135deg, var(--modal-primary-color), #2c5282);
    color: white;
    padding: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    text-align: center;
}

header .profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--modal-secondary-color);
    object-fit: cover;
    flex-shrink: 0;
}

header .header-text h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: var(--modal-secondary-color);
}

header .header-text p {
    font-size: 1.2em;
    opacity: 0.9;
}

.cv-section {
    background-color: var(--modal-card-bg);
    margin-top: 30px;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-top: 4px solid var(--modal-primary-color);
}

.cv-section h2 {
    color: var(--modal-primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--modal-secondary-color);
    font-size: 1.8em;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-item i {
    color: var(--modal-secondary-color);
    font-size: 1.2em;
    width: 25px;
}

ul.styled-list {
    list-style: none;
    padding-right: 0;
}

ul.styled-list li {
    background-color: var(--modal-background-color);
    padding: 15px;
    margin-bottom: 10px;
    border-right: 4px solid var(--modal-secondary-color);
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

ul.styled-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.playlist {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.playlist li {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
    font-family: 'Cairo', sans-serif;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.playlist li:last-child {
    border-bottom: none;
}

.playlist li:not(.active):hover {
    background-color: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.playlist li.active {
    background-color: var(--modal-primary-color);
    color: var(--modal-secondary-color);
    font-weight: 600;
}

.playlist li .time {
    font-weight: 700;
    color: #6c757d;
    min-width: 60px;
    text-align: left;
}

.playlist li.active .time {
    color: var(--modal-secondary-color);
}

.playlist li .title {
    flex-grow: 1;
    padding-right: 15px;
    color: var(--modal-text-color);
}

.playlist li.active .title {
    color: var(--modal-secondary-color);
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    header .header-text h1 {
        font-size: 2em;
    }
}