/* Course Page Styles */

.search-section.sticky {
    position: sticky;
    top: 57px;
    margin: 0;
    width: 100%;
    z-index: 900;
    background: var(--surface);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
}

/* ✅ UI POLISH: Spacing matched to career.css strictness */
.hero-banner {
    padding: 2rem 0 0.5rem 0;
    /* Tight bottom padding */
    background-color: var(--bg-main);
}

.hero-nav {
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 1.75rem;
    /* Was 2.5rem */
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.course-view {
    padding: var(--spacing-xl) 0;
    max-width: 1200px;
    margin: 0 auto;
}

.overlap-container {
    padding-top: 0.5rem;
    position: relative;
    z-index: 2;
}

/* Sections */
.section-block {
    margin-bottom: 3rem;
}

.section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 1.1rem;
    /* Was 1.5rem */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =========================================
   📖 Books Grid Layout
   Large cover-style cards
   ========================================= */

/* =========================================
   📖 Premium Book Grid (Netflix Style)
   ========================================= */

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    /* ✅ UPDATE: Más pequeño y denso (antes 160px) */
    gap: 1.5rem;
    margin-top: 1rem;
}

.book-card-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Reducido ligeramente */
}

.book-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: transparent;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    /* Tailwind-like grouping concept */
}

/* Hover Effect: Lift up */
.book-card:hover {
    transform: translateY(-8px);
    /* ✅ UPDATE: Mayor elevación */
    z-index: 10;
}

.book-cover-container {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    /* ✅ UPDATE: Bordes menos redondeados para realismo */
    overflow: hidden;
    position: relative;
    /* ✅ 3D EFFECT: Realistic Book Style - Minimalist Shadow */
    box-shadow:
        /* Sombra de contacto suave */
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* 3D Spine Effect using Pseudo-element */
.book-cover-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 8px;
    /* Reducido para escala */
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0.3) 0%,
            rgba(255, 255, 255, 0) 100%);
    z-index: 10;
    pointer-events: none;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.book-card:hover .book-cover-container {
    /* ✅ UPDATE: Rotación y sombra de proyección profunda + GLOW AZUL */
    transform: rotateY(-8deg);
    /* Un poco más de rotación */
    box-shadow:
        /* Sombra proyectada */
        15px 20px 30px rgba(0, 0, 0, 0.25),
        /* Brillo especular sutil */
        inset 0 0 20px rgba(255, 255, 255, 0.05),
        /* ✅ GLOW AZUL SOLICITADO */
        0 0 25px rgba(56, 189, 248, 0.6);
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Slight zoom on hover */
.book-card:hover .book-cover-img {
    transform: scale(1.05);
    /* Zoom sutil pero notable */
}

/* Overlay Icon (Audio/Read) */
.book-overlay-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    /* ✅ UPDATE: Oculto por defecto para minimalismo */
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.book-card:hover .book-overlay-icon {
    opacity: 1;
    /* Mostrar al hover */
    transform: translateY(0);
}

.book-info {
    padding-top: 0.5rem;
    text-align: center;
    /* ✅ UPDATE: Centrado para mayor elegancia */
}

.book-title {
    font-size: 0.9rem;
    /* ✅ UPDATE: Ligeramente más pequeño */
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.1rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.book-author {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.8;
}

/* ✅ NEW: Action Buttons Footer (Optimized for Compact View) */
.book-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 4px;
    /* More compact padding */
    border-radius: 5px;
    font-size: 0.8rem;
    /* Smaller text */
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-action.read {
    background-color: var(--surface-alt);
    color: var(--text-main);
    border-color: var(--border);
}

.btn-action.read:hover {
    background-color: var(--border);
    transform: translateY(-1px);
}

.btn-action.cite {
    background-color: white;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-action.cite:hover {
    background-color: var(--accent);
    color: white;
    transform: translateY(-1px);
}

/* ✅ NEW: Citation Modal Styles */
.citation-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px 8px 0 0;
    padding: 0 10px;
}

.tab-link {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.tab-link:hover {
    color: var(--text-main);
}

.tab-link.active {
    border-bottom-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.citation-content {
    animation: fadeIn 0.3s ease;
}

.citation-box {
    background: var(--surface);
    /* Dark mode compatible */
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
    min-height: 100px;
    display: flex;
    align-items: center;
}

.citation-text {
    margin: 0;
    font-family: 'Georgia', serif;
    /* Academic feel */
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-main);
    padding-right: 2rem;
    /* Space for copy button */
}

.btn-copy-floating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-floating:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-copy-large {
    width: 100%;
    padding: 12px;
    background: #10b981;
    /* Green Success */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn-copy-large:hover {
    background: #059669;
    transform: translateY(-1px);
}