/* ═══════════════════════════════════════════════════════════════════════════
   Homepage Carousel & Content Previews — Guest View CSS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Carousel ─────────────────────────────────────────────────────────────── */
.pl-home-carousel {
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.pl-home-carousel .carousel-inner {
    border-radius: 16px;
}
.pl-home-slide {
    padding: 48px 32px;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}
.pl-home-slide-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.9;
}
.pl-home-slide h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.2;
}
.pl-home-slide p {
    font-size: 0.95rem;
    opacity: 0.88;
    margin-bottom: 16px;
    max-width: 480px;
}
.pl-home-slide .btn {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Carousel controls */
.pl-home-carousel .carousel-control-prev,
.pl-home-carousel .carousel-control-next {
    width: 40px;
    opacity: 0.7;
}
.pl-home-carousel .carousel-control-prev:hover,
.pl-home-carousel .carousel-control-next:hover {
    opacity: 1;
}
.pl-home-carousel .carousel-indicators {
    margin-bottom: 8px;
}
.pl-home-carousel .carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.5;
}
.pl-home-carousel .carousel-indicators button.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .pl-home-slide {
        padding: 32px 20px;
        min-height: 220px;
    }
    .pl-home-slide-icon { font-size: 2rem; }
    .pl-home-slide h2 { font-size: 1.2rem; }
    .pl-home-slide p { font-size: 0.85rem; }
}

@media (max-width: 400px) {
    .pl-home-slide {
        padding: 24px 16px;
        min-height: 200px;
    }
    .pl-home-slide h2 { font-size: 1.05rem; }
}

/* ── Content Previews ─────────────────────────────────────────────────────── */
.pl-home-preview {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}
@media (max-width: 767px) {
    .pl-home-preview { margin-bottom: 12px; height: auto; }
}

/* ── Mini Music Player ────────────────────────────────────────────────────── */
.pl-home-tracks {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.pl-home-tracks::-webkit-scrollbar { width: 4px; }
.pl-home-tracks::-webkit-scrollbar-track { background: transparent; }
.pl-home-tracks::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
/* Fade hint at bottom to signal scrollability */
.pl-home-preview:has(.pl-home-tracks) { position: relative; }
.pl-home-tracks-fade {
    position: absolute;
    bottom: 56px; /* above mini player */
    left: 16px;
    right: 16px;
    height: 28px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
    border-radius: 0 0 10px 10px;
}
@media (max-width: 768px) {
    .pl-home-tracks { max-height: 240px; }
}
.pl-home-track {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.pl-home-track:hover {
    background: #f8f9fa;
}
.pl-home-track.active {
    background: #fff0f3;
}
.pl-home-track-rank {
    font-size: 0.95rem;
    font-weight: 700;
    color: #bbb;
    min-width: 20px;
    text-align: center;
}
.pl-home-track.active .pl-home-track-rank {
    color: #FF2D55;
}
.pl-home-track-art {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
    position: relative;
}
.pl-home-track-play-icon {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    border-radius: 8px;
    font-size: 0.8rem;
}
.pl-home-track:hover .pl-home-track-play-icon {
    display: flex;
}
.pl-home-track-info {
    flex: 1;
    min-width: 0;
}
.pl-home-track-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-home-track-artist {
    font-size: 0.75rem;
    color: #888;
}
.pl-home-track-plays {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
}

/* Mini Player Bar */
.pl-home-mini-player {
    margin-top: 12px;
    padding: 10px 12px;
    background: #1a1a2e;
    border-radius: 10px;
    color: #fff;
}
.pl-home-mini-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #FF2D55;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.pl-home-mini-title {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-home-mini-artist {
    font-size: 0.7rem;
    color: #aaa;
}
.pl-home-mini-progress {
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}
.pl-home-mini-progress-bar {
    height: 100%;
    background: #FF2D55;
    width: 0;
    transition: width 0.3s linear;
}

/* ── Books Preview Grid ───────────────────────────────────────────────────── */
.pl-home-books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.pl-home-book {
    text-align: center;
    text-decoration: none;
    color: #34495e;
    display: block;
    transition: transform 0.2s ease;
}
.pl-home-book:hover {
    transform: translateY(-3px);
}
.pl-home-book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 6px;
}
.pl-home-book-cover-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 8px;
    background: linear-gradient(135deg, #FF9500 0%, #FF6B35 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 6px;
}
.pl-home-book-title {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pl-home-book-author {
    font-size: 0.68rem;
    color: #888;
}
.pl-home-book-badges {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 3px;
}
.pl-home-book-badge {
    font-size: 0.65rem;
    color: #666;
}

@media (max-width: 400px) {
    .pl-home-books-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* ── Platform Feature Grid (Homepage) ─────────────────────────────────────── */
.pl-home-platform-grid {
    margin-top: 24px;
}
.pl-home-platform-category {
    font-size: 0.85rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    margin-top: 20px;
}
.pl-home-platform-category:first-child {
    margin-top: 0;
}
.pl-home-platform-card {
    display: block;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 14px 12px;
    text-decoration: none;
    color: #34495e;
    text-align: center;
    height: 100%;
    transition: box-shadow 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}
.pl-home-platform-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: #007AFF;
    color: #34495e;
}
.pl-home-platform-card i {
    font-size: 1.4rem;
    margin-bottom: 6px;
    display: block;
}
.pl-home-platform-card h6 {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 3px;
    color: #1a1a2e;
}
.pl-home-platform-card .small {
    font-size: 0.68rem;
    color: #888;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .pl-home-platform-card { padding: 10px 8px; }
    .pl-home-platform-card i { font-size: 1.2rem; }
    .pl-home-platform-card h6 { font-size: 0.72rem; }
}
