/* ============================================================
   ESTILOS - ZONA DE TUTORIALES & ACADEMIA PAPERTOOLS
   ============================================================ */

.tutorials-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem 1.25rem;
}

/* Hero de Tutoriales */
.tutorials-hero {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-xl, 20px);
    padding: 2rem 2.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.tutorials-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #7c3aed, #db2777, #f59e0b);
}

.tutorials-hero-content {
    max-width: 680px;
}

.tutorials-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.25);
    font-size: 0.76rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.tutorials-hero-title {
    font-size: 1.85rem;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.tutorials-hero-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Barra de Búsqueda y Filtro de Categorías */
.tutorials-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.tutorials-nav-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    max-width: 100%;
}

.tutorial-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tutorial-tab-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: var(--bg-hover);
}

.tutorial-tab-btn.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px var(--shadow-glow);
}

/* Reproductor Personalizado de Enlaces de YouTube */
.custom-yt-box {
    background: var(--bg-card);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-lg, 16px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.custom-yt-input-group {
    display: flex;
    flex: 1;
    min-width: 280px;
    gap: 8px;
}

.custom-yt-input {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
}

.custom-yt-input:focus {
    border-color: var(--color-primary);
}

/* Grid de Tutoriales */
.tutorials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.tutorial-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.tutorial-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.tutorial-thumb-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tutorial-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.88;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.tutorial-card:hover .tutorial-thumb-img {
    transform: scale(1.04);
    opacity: 0.98;
}

.tutorial-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.92);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, background 0.2s ease;
}

.tutorial-card:hover .tutorial-play-overlay {
    transform: translate(-50%, -50%) scale(1.12);
    background: #ef4444;
}

.tutorial-duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.tutorial-cat-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

.tutorial-info {
    padding: 1.25rem 1.35rem 1.5rem 1.35rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tutorial-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
}

.tutorial-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1rem 0;
    line-height: 1.45;
    flex: 1;
}

.tutorial-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Modal de Reproducción de Video */
.video-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.video-modal-backdrop.hidden {
    display: none !important;
}

.video-modal-box {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    animation: fadeInScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-modal-header {
    padding: 1rem 1.5rem;
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-player-frame-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000000;
    position: relative;
}

.video-player-frame-container iframe,
.video-player-frame-container video {
    width: 100%;
    height: 100%;
    border: none;
}

.video-modal-details {
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .tutorials-hero {
        padding: 1.5rem;
    }
    .tutorials-hero-title {
        font-size: 1.45rem;
    }
    .tutorials-grid {
        grid-template-columns: 1fr;
    }
}
