/* ================================================================
   HOMEPAGE STYLES - Novelas Boku
   Premium visual design with glassmorphism & micro-animations
   ================================================================ */

.home-layout {
    display: flex;
    gap: 28px;
    max-width: 1200px;
    margin: 24px auto 40px;
    padding: 0 20px;
    /* Align with navbar padding */
}

.home-main-content {
    flex: 1;
    min-width: 0;
}

.home-sidebar {
    width: 300px;
    flex-shrink: 0;
    padding-top: 42px;
    /* Align with novel cards, below section header */
}

/* === SECTION HEADERS === */
.section-title-unified {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-unified i {
    color: #a78bfa;
    font-size: 1.1rem;
}

/* === ÚLTIMAS NOVELAS GRID === */
.latest-novels-section {
    margin-bottom: 36px;
}

.latest-novels-section .section-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding: 0 4px;
}

.view-all-btn {
    color: #818cf8;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-all-btn:hover {
    color: #c4b5fd;
    gap: 8px;
}

.latest-novels-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

/* === NOVEL CARDS === */
.grid-novel-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.grid-novel-card:hover {
    transform: translateY(-6px);
    z-index: 2;
}

.grid-novel-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1e1e3a, #0f172a);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: box-shadow 0.3s ease;
}

.grid-novel-card:hover .grid-novel-cover {
    box-shadow:
        0 8px 30px rgba(139, 92, 246, 0.2),
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.grid-novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.3s ease;
}

.grid-novel-card:hover .grid-novel-cover img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

/* Shine effect on hover */
.card-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.6s ease;
    z-index: 2;
    pointer-events: none;
}

.grid-novel-card:hover .card-shine {
    left: 120%;
}

/* Badges */
.grid-novel-cover .img-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.img-badge.new {
    background: linear-gradient(135deg, #22c55e, #059669);
    color: #fff;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.4);
}

.img-badge.update {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.grid-novel-info {
    padding: 8px 4px 4px;
}

.grid-novel-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #c8d0e0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    transition: color 0.2s;
}

.grid-novel-card:hover .grid-novel-title {
    color: #e2e8f0;
}

/* === NEWS SECTION === */
.news-section-home {
    margin-top: 10px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.news-cards-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.news-card {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
}

.news-card:hover {
    border-color: rgba(139, 92, 246, 0.25);
    background: rgba(15, 23, 42, 0.8);
    transform: translateX(3px);
}

.news-card-accent {
    width: 4px;
    background: linear-gradient(180deg, #818cf8, #6366f1);
    flex-shrink: 0;
}

.news-card.pinned .news-card-accent {
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

.news-card-body {
    padding: 14px 16px;
    flex: 1;
}

.pinned-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.news-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 4px 0;
    line-height: 1.4;
}

.news-card-content {
    font-size: 0.82rem;
    color: #94a3b8;
    margin: 6px 0 8px;
    line-height: 1.5;
}

.news-card-date {
    font-size: 0.72rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* === SIDEBAR === */
.sidebar-section {
    background: rgba(15, 15, 35, 0.7);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.3s ease;
}

.sidebar-section:hover {
    border-color: rgba(139, 92, 246, 0.15);
}

.sidebar-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, rgba(139, 92, 246, 0.5), transparent) 1;
}

.sidebar-title,
.sidebar-title-clean {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title {
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, rgba(139, 92, 246, 0.5), transparent) 1;
}

.sidebar-title i,
.sidebar-title-clean i {
    color: #a78bfa;
}

.popular-time-filters {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px;
    border-radius: 12px;
}

.popular-time-filters .filter-btn {
    padding: 2px 8px;
    font-size: 0.7rem;
}

/* === TELEGRAM WIDGET === */
.telegram-section {
    padding: 0;
    overflow: hidden;
    border: none;
    background: none;
}

.telegram-widget {
    display: block;
    text-decoration: none;
}

.telegram-banner {
    background: linear-gradient(135deg, #0088cc 0%, #0099dd 50%, #00aaee 100%);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.telegram-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.telegram-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 136, 204, 0.35);
}

.telegram-icon-wrap {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.telegram-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.telegram-label {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.telegram-name {
    font-size: 1.1rem;
    font-weight: 800;
}

.telegram-arrow {
    font-size: 0.8rem;
    opacity: 0.6;
    transition: transform 0.2s;
}

.telegram-banner:hover .telegram-arrow {
    transform: translateX(3px);
    opacity: 1;
}

/* === POPULAR RANKING === */
.popular-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 10px;
}

.popular-rank-item {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: #e2e8f0;
    transition: all 0.2s ease;
}

.popular-rank-item:hover {
    transform: translateX(4px);
}

.popular-rank-item.featured {
    display: block;
    margin-bottom: 12px;
}

.popular-rank-item.featured:hover {
    transform: translateY(-4px);
}

.rank-featured-cover {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.rank-featured-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    opacity: 0.8;
}

.popular-rank-item.featured:hover .rank-featured-cover img {
    transform: scale(1.05);
    opacity: 1;
}

.rank-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px 16px;
    background: linear-gradient(to top, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.6) 60%, transparent 100%);
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.rank-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #4f46e5;
    width: 28px;
    /* Fixed width for perfect alignment */
    text-align: left;
    line-height: 1;
    font-family: 'Outfit', sans-serif;
    flex-shrink: 0;
}

.rank-number.gold {
    font-size: 3rem;
    color: #fbbf24;
    text-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    line-height: 0.8;
    margin-bottom: -4px;
}

.rank-number.top2 {
    color: #c4b5fd;
}

.rank-number.top3 {
    color: #d8b4fe;
}

.rank-number.top4 {
    color: #818cf8;
}

.rank-info {
    flex: 1;
}

.rank-info h4,
.rank-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rank-details h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.rank-genres {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
    margin-top: 4px;
}

.rank-cover-small {
    width: 56px;
    height: 76px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.rank-cover-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rank-details {
    flex: 1;
    min-width: 0;
}

/* === GENRES CLOUD === */
.genres-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.genre-chip {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    color: #a5b4fc;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.genre-chip:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #e0e7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .latest-novels-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .home-sidebar {
        width: 260px;
    }

    .latest-novels-grid {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .home-layout {
        flex-direction: column;
    }

    .home-sidebar {
        width: 100%;
        order: 2;
    }

    .latest-novels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .latest-novels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.latest-novels-section {
    animation: fadeInUp 0.5s ease-out;
}

.sidebar-section {
    animation: fadeInUp 0.5s ease-out;
}

.sidebar-section:nth-child(2) {
    animation-delay: 0.1s;
}

.sidebar-section:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================
   ★ SPOTLIGHT CAROUSEL STYLES ★
   ============================================ */
.spotlight-carousel {
    position: relative;
    width: calc(100% - 40px);
    /* Account for 20px padding on each side */
    max-width: calc(1200px - 40px);
    margin: 12px auto 28px;
    border-radius: 16px;
    overflow: hidden;
    background: #0a0a1a;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    height: 320px;
    cursor: grab;
}

.spotlight-carousel.is-dragging {
    cursor: grabbing !important;
}

.spotlight-carousel.is-dragging .spotlight-slide {
    pointer-events: none;
    /* Prevent clicking descendants while dragging */
}

.spotlight-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.spotlight-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.spotlight-slide.active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
}

/* Background */
.spotlight-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.spotlight-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(20px) brightness(0.3) saturate(1.4);
    transform: scale(1.2);
}

/* Content overlay */
.spotlight-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 30px 40px;
    gap: 30px;
}

/* Info Left */
.spotlight-info {
    flex: 1;
    min-width: 0;
}

.spotlight-star {
    color: #fbbf24;
    font-size: 1.8rem;
    margin-bottom: 6px;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.spotlight-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: uppercase;
}

.spotlight-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.spotlight-genre {
    padding: 2px 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #cbd5e1;
    font-size: 0.7rem;
    font-weight: 600;
}

.spotlight-synopsis-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.spotlight-synopsis {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.spotlight-meta {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 14px;
}

.spotlight-meta strong {
    color: #e2e8f0;
}

.spotlight-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.spotlight-btn:hover {
    background: linear-gradient(135deg, #a78bfa, #818cf8);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

/* Cover Art Right */
.spotlight-cover-area {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.spotlight-cover-main {
    width: 180px;
    height: 260px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(139, 92, 246, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s ease;
}

.spotlight-slide.active .spotlight-cover-main {
    animation: coverSlideIn 0.7s ease-out;
}

@keyframes coverSlideIn {
    from {
        transform: translateX(30px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.spotlight-cover-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.filter-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Dot Navigation */
.spotlight-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.spotlight-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.spotlight-dot.active {
    background: #fbbf24;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.spotlight-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .spotlight-carousel {
        height: 260px;
    }

    .spotlight-content {
        padding: 20px;
        gap: 15px;
    }

    .spotlight-title {
        font-size: 1.2rem;
    }

    .spotlight-cover-main {
        width: 120px;
        height: 170px;
    }

    .spotlight-synopsis {
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 480px) {
    .spotlight-carousel {
        height: 260px;
        /* Give it a bit more vertical breathing room */
    }

    .spotlight-content {
        padding: 15px 12px;
        gap: 10px;
    }

    .spotlight-cover-main {
        width: 90px;
        height: 130px;
        border-radius: 8px;
    }

    .spotlight-info {
        flex: 1;
    }

    .spotlight-title {
        font-size: 1rem;
        margin-bottom: 4px;
    }

    .spotlight-star {
        font-size: 1.3rem;
        margin-bottom: 2px;
    }

    .spotlight-genre {
        padding: 1px 6px;
        font-size: 0.65rem;
    }

    .spotlight-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
    }

    .spotlight-synopsis {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
        margin-bottom: 8px;
    }

    .spotlight-meta {
        margin-bottom: 8px;
        font-size: 0.7rem;
    }
}