/**
 * Lyrics3s Home Page Stylesheet (home.css)
 * Tông màu chủ đạo: Trắng & Tím (Logo Astronaut)
 * < 350 dòng code theo quy ước rules.md
 */

@import url('home-components.css');

/* Container */
.l3s-home-page-container { width: 100%; padding-bottom: 60px; }

/* 1. Hero Search Section */
.l3s-home-hero-section {
    padding: 60px 0;
    text-align: center;
    background-color: var(--bg-card);
    background-image: linear-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(124, 58, 237, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: center top;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}
.l3s-home-hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, var(--bg-app) 95%);
    pointer-events: none;
    z-index: 0;
}
.l3s-home-hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
}

.l3s-home-hero-title {
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.l3s-home-hero-desc {
    font-size: 16px;
    color: var(--text-sub);
    margin: 0 0 32px;
}

/* Search Box */
.l3s-home-search-wrap {
    position: relative;
    width: 100%;
}

.l3s-home-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.l3s-home-search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
}

.l3s-home-search-field {
    width: 100%;
    height: 60px;
    padding: 0 100px 0 52px;
    border-radius: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 16px;
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    outline: none;
    transition: all 0.2s;
}

.l3s-home-search-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.l3s-home-search-submit {
    position: absolute;
    right: 8px;
    height: 44px;
    padding: 0 24px;
    border-radius: 22px;
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.l3s-home-search-submit:hover {
    opacity: 0.9;
}

.l3s-home-search-suggest { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; }
.l3s-suggest-label { color: var(--text-sub); font-weight: 500; margin-right: 4px; }
.l3s-suggest-chip { display: inline-flex; align-items: center; padding: 4px 12px; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--border-color); border-radius: 16px; color: var(--text-secondary); text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.l3s-suggest-chip:hover { background: var(--bg-card); border-color: var(--primary-border); color: var(--primary); transform: translateY(-1px); }

/* Autocomplete Dropdown */
.l3s-home-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    z-index: 50;
    text-align: left;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .l3s-home-hero-section { padding: 40px 0; }
    .l3s-home-hero-title { font-size: 28px; }
    .l3s-home-search-field { height: 54px; font-size: 15px; padding-right: 90px; }
    .l3s-home-search-submit { height: 40px; padding: 0 16px; right: 7px; }
}

/* 2. Common Section Styles */
.l3s-home-section { padding: 40px 0; border-bottom: 1px solid var(--border-subtle); }
.l3s-home-section:last-child { border-bottom: none; }
.l3s-home-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.l3s-home-section-title { font-family: var(--font-heading); font-size: 22px; font-weight: 800; color: var(--text-primary); margin: 0; }
.l3s-home-view-all { font-size: 13.5px; font-weight: 600; color: var(--primary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: color 0.2s; }
.l3s-home-view-all:hover { color: var(--primary-hover); text-decoration: underline; }

/* 3. New Songs / Album Grid (Stack Layout) */
.l3s-new-songs-section { padding-top: 32px; padding-bottom: 8px; border-bottom: none; }
.l3s-home-stack-container { display: flex; align-items: stretch; justify-content: space-between; padding: 12px 0 16px; overflow-x: auto; scrollbar-width: none; }
.l3s-home-stack-container::-webkit-scrollbar { display: none; }
.l3s-stack-intro-card { background: #000; color: #fff; border-radius: 12px; padding: 24px 20px; width: 160px; flex-shrink: 0; z-index: 50; position: sticky; left: 0; display: flex; flex-direction: column; justify-content: center; box-shadow: 10px 0 20px rgba(0,0,0,0.15); }
.l3s-stack-intro-card::before { content: ""; position: absolute; inset: 0; border-radius: 12px; padding: 3px; background: linear-gradient(135deg, #f97316 0%, #e11d48 30%, #8b5cf6 70%, #06b6d4 100%); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.l3s-stack-intro-card svg { margin-bottom: 20px; }
.l3s-stack-intro-card h2 { font-family: var(--font-heading); font-size: 22px; font-weight: 800; line-height: 1.2; margin: 0 0 12px; }
.l3s-stack-intro-card a { font-size: 13.5px; font-weight: 600; color: #fff; text-decoration: none; opacity: 0.8; transition: opacity 0.2s; }
.l3s-stack-intro-card a:hover { opacity: 1; }

.l3s-stack-items { display: flex; align-items: stretch; padding: 16px 0; }
.l3s-stack-card { border-radius: 12px; padding: 20px; width: 200px; min-height: 280px; flex-shrink: 0; margin-left: -50px; box-shadow: -8px 0 20px rgba(0,0,0,0.06); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--text-primary); }
.l3s-stack-card:hover { transform: translateY(-20px) rotate(-3deg) scale(1.02); z-index: 30; box-shadow: -15px 15px 30px rgba(0,0,0,0.1); }

.l3s-stack-card-top { display: flex; align-items: center; font-size: 11px; color: rgba(0,0,0,0.4); font-weight: 600; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 0.5px; }
.l3s-stack-views { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.l3s-stack-card-title { font-family: var(--font-heading); font-size: 19px; font-weight: 800; color: #111; margin: 0 0 24px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.l3s-stack-card-bottom { margin-top: auto; }
.l3s-stack-tags { font-size: 10px; font-weight: 700; color: rgba(0,0,0,0.4); margin-bottom: 16px; letter-spacing: 0.5px; }
.l3s-stack-author { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; }
.l3s-stack-avatar { width: 28px; height: 28px; min-width: 28px; min-height: 28px; max-width: 28px; max-height: 28px; aspect-ratio: 1 / 1; flex-shrink: 0; flex-grow: 0; border-radius: 50%; overflow: hidden; background: #fff; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.l3s-stack-avatar img { width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; display: block; }
.l3s-stack-avatar svg { width: 14px; height: 14px; flex-shrink: 0; color: #666; }
.l3s-stack-avatar .l3s-mood-dummy-thumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.l3s-stack-author-name { font-size: 12.5px; font-weight: 600; color: #222; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }

/* 4. Trending Songs */
.l3s-home-trending-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; }
.l3s-home-trending-item { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; text-decoration: none; transition: all 0.2s; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02); min-width: 0; }
.l3s-home-trending-item:hover { border-color: var(--primary-border); background: var(--bg-subtle); transform: translateX(4px); }
.l3s-trending-rank { font-family: var(--font-heading); font-size: 20px; font-weight: 800; color: var(--text-muted); width: 28px; text-align: center; flex-shrink: 0; }
.l3s-home-trending-item:hover .l3s-trending-rank { color: var(--primary); }
.l3s-trending-info { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.l3s-trending-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l3s-trending-artist { font-size: 13.5px; color: var(--text-sub); flex-shrink: 0; max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }

/* Responsive */
@media (max-width: 992px) {
    .l3s-home-cards-scroll { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
    .l3s-home-cards-scroll::-webkit-scrollbar { display: none; }
    .l3s-home-song-grid { display: flex; gap: 16px; padding-bottom: 8px; }
    .l3s-home-song-card { flex: 0 0 140px; scroll-snap-align: start; }
    
    .l3s-home-trending-grid { grid-template-columns: 1fr; gap: 10px; }
    .l3s-home-trending-item:nth-child(n+6) { display: none; }
}

/* 5. Explore Tags */
.l3s-tags-cloud { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.l3s-tag-chip { padding: 10px 20px; border-radius: 100px; font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s ease; border: 1px solid var(--border-color); background: #fff; color: var(--text-primary); }
.l3s-tag-chip:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.l3s-tag-genre { background: #fdf2f8; border-color: #fbcfe8; color: #be185d; }
.l3s-tag-genre:hover { background: #fce7f3; }
.l3s-tag-mood { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.l3s-tag-mood:hover { background: #dcfce7; }
.l3s-tag-nation { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.l3s-tag-nation:hover { background: #dbeafe; }

/* 6. Featured Artists */
.l3s-artists-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; padding-top: 8px; }
.l3s-artist-card { display: flex; flex-direction: column; align-items: center; text-decoration: none; text-align: center; min-width: 0; width: 100%; }
.l3s-artist-avatar { width: 140px; height: 140px; border-radius: 50%; overflow: hidden; background: #f3f0f9; border: 1px solid var(--border-color); margin-bottom: 16px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.04); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s; }
.l3s-artist-avatar img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.l3s-artist-avatar svg { width: 40px; height: 40px; color: var(--primary); opacity: 0.5; }
.l3s-artist-card:hover .l3s-artist-avatar { transform: translateY(-8px) scale(1.05); box-shadow: 0 12px 24px rgba(0,0,0,0.1); }
.l3s-artist-name { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; line-height: 1.3; }
.l3s-artist-role { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* 7. Featured Albums */
.l3s-albums-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; padding-top: 8px; }
.l3s-album-card { display: flex; flex-direction: column; text-decoration: none; min-width: 0; width: 100%; }
.l3s-album-cover { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f3f0f9; border: 1px solid var(--border-color); margin-bottom: 16px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.04); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s; }
.l3s-album-cover img { width: 100%; height: 100%; object-fit: cover; }
.l3s-album-cover svg { width: 40px; height: 40px; color: var(--primary); opacity: 0.5; }
.l3s-album-card:hover .l3s-album-cover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(0,0,0,0.1); }
.l3s-album-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.l3s-album-artist { font-size: 13px; font-weight: 500; color: var(--text-muted); }

/* 8. Editorial */
.l3s-editorial-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-top: 8px; }
.l3s-editorial-card { display: flex; flex-direction: column; text-decoration: none; background: var(--bg-card); border-radius: 12px; overflow: hidden; border: 1px solid var(--border-color); transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.02); min-width: 0; width: 100%; }
.l3s-editorial-card:hover { transform: translateY(-6px); box-shadow: 0 12px 24px rgba(0,0,0,0.08); }
.l3s-editorial-cover { width: 100%; aspect-ratio: 16/9; background: var(--bg-subtle); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--border-color); overflow: hidden; }
.l3s-editorial-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.l3s-editorial-card:hover .l3s-editorial-cover img { transform: scale(1.05); }
.l3s-editorial-cover svg { width: 40px; height: 40px; color: var(--primary); opacity: 0.5; }
.l3s-editorial-info { padding: 16px; }
.l3s-editorial-date { font-size: 11px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; display: block; }
.l3s-editorial-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 992px) {
    .l3s-artists-grid, .l3s-albums-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .l3s-editorial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 768px) {
    .l3s-artists-grid, .l3s-albums-grid {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
        padding-bottom: 16px;
        gap: 16px;
    }
    .l3s-artists-grid::-webkit-scrollbar, .l3s-albums-grid::-webkit-scrollbar { display: none; }
    .l3s-artist-card { flex: 0 0 130px; scroll-snap-align: start; }
    .l3s-album-card { flex: 0 0 140px; scroll-snap-align: start; }
    .l3s-editorial-grid { grid-template-columns: 1fr; }

    .l3s-home-stack-container {
        flex-direction: column;
        padding: 0 0 10px;
        overflow: visible;
    }
    .l3s-stack-intro-card {
        width: 100%;
        position: relative;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        margin-bottom: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    .l3s-stack-intro-card svg { display: none; }
    .l3s-stack-intro-card h2 { font-size: 18px; margin: 0; white-space: nowrap; }
    .l3s-stack-intro-card h2 br { display: none; }
    .l3s-stack-intro-card a { white-space: nowrap; margin-left: 16px; }

    .l3s-stack-items {
        padding: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .l3s-stack-items::-webkit-scrollbar { display: none; }
    .l3s-stack-card {
        margin-left: -50px;
        flex: 0 0 185px;
        scroll-snap-align: start;
        min-height: 240px;
    }
    .l3s-stack-card:first-child {
        margin-left: 0;
    }
}
