@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&family=Noto+Sans+JP:wght@400;700&display=swap');

/* 基本スタイル */
:root {
    --bg-color: #0f0c29;
    --text-white: #ffffff;
    --pink-accent: #FF0080;
    --purple-accent: #7928CA;
    --cyan-accent: #00F2FE;
    --blue-accent: #4FACFE;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background: var(--bg-color);
    color: var(--text-white);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.min-h-screen {
    min-height: 100vh;
}

.pb-24 {
    padding-bottom: 6rem;
}

/* ガラスエフェクト */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* グラデーション */
.pop-gradient {
    background: linear-gradient(135deg, var(--pink-accent) 0%, var(--purple-accent) 100%);
}

.neo-gradient {
    background: linear-gradient(90deg, var(--cyan-accent) 0%, var(--blue-accent) 100%);
}

/* ヘッダー */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 2.5rem;
    /* Match user-btn height */
    width: auto;
    object-fit: contain;
}

/* ユーティリティ */
.hidden {
    display: none !important;
}

.user-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    color: white;
    padding: 0;
    transition: transform 0.2s;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ユーザーメニュー */
.user-menu {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    width: 12rem;
    border-radius: 1rem;
    padding: 1rem;
    z-index: 50;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s;
    text-decoration: none;
    /* For a tags */
}

.menu-item:hover {
    color: var(--pink-accent);
}

.menu-item.logout {
    color: #f87171;
}

.divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0;
}

/* メインコンテンツ */
.main {
    padding-top: 6rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ヒーローセクション */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.hero-bg-container {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-bg-img.bg-1 {
    z-index: 1;
}

.hero-bg-img.bg-2 {
    z-index: 2;
    animation: bgFade 15s infinite;
}

@keyframes bgFade {

    0%,
    15% {
        opacity: 0;
    }

    45%,
    55% {
        opacity: 1;
    }

    85%,
    100% {
        opacity: 0;
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: linear-gradient(135deg, rgba(219, 39, 119, 0.7) 0%, rgba(121, 40, 202, 0.7) 100%);
    /* Pink/Purple with transparency */
}

.hero h2 {
    font-size: 1.875rem;
    font-weight: 900;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.hero p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 1.5rem 0;
}

.register-btn {
    background: white;
    color: #db2777;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    /* For a tags */
}

.hero-bg-icon {
    position: absolute;
    right: -1rem;
    bottom: -1rem;
    opacity: 0.2;
    transform: rotate(12deg);
}

/* セクション共通 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.see-all {
    font-size: 0.75rem;
    color: var(--pink-accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
}

/* 横スクロールリスト */
.horizontal-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.thumb-link,
.info-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.thumb-link .song-thumb {
    transition: transform 0.2s;
}

.thumb-link:hover .song-thumb {
    transform: scale(1.02);
}

.info-link:hover .song-title {
    color: var(--pink-accent);
}

.song-card {
    flex-shrink: 0;
    width: 9rem;
    cursor: pointer;
}

.song-thumb {
    width: 9rem;
    height: 9rem;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.play-icon {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s;
}

.song-card:hover .play-icon {
    opacity: 0.8;
    transform: scale(1);
}

.song-title {
    font-weight: 700;
    font-size: 0.875rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    margin: 0;
}

/* ランキング */
.ranking-container {
    border-radius: 1.5rem;
    padding: 1.5rem;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.ranking-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rank-number {
    font-size: 1.125rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.rank-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    overflow: hidden;
    flex-shrink: 0;
}

.rank-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.rank-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.rank-info {
    flex: 1;
    min-width: 0;
    /* Crucial for text truncation in flex items */
    overflow: hidden;
}

.ranking-item .song-title,
.ranking-item .song-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-stats {
    text-align: right;
    flex-shrink: 0;
    /* Prevent arrow from being pushed out */
    width: 20px;
    /* Optional: Ensure consistent space for arrow */
}

.rank-arrow-icon {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.5);
}

.section-icon {
    width: 20px;
    height: 20px;
    color: #22d3ee;
}

.ranking-section-title {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.views-text {
    font-size: 0.625rem;
    color: var(--pink-accent);
    font-weight: 700;
}

/* プレイリストグリッド */
.playlist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.playlist-card {
    border-radius: 1.5rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.playlist-tag {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    width: fit-content;
    color: black;
    text-transform: uppercase;
    z-index: 10;
}

.topic-thumb-link {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    /* Square thumbnail */
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
}

.topic-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.topic-thumb-link:hover .topic-thumb {
    transform: scale(1.05);
}

.topic-info-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.topic-info-link .song-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.topic-info-link:hover .song-title {
    color: var(--pink-accent);
}

/* ボトムナビゲーション */
.bottom-nav {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    height: 4rem;
    border-radius: 9999px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 1rem;
    z-index: 50;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}


.nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: none;
    background: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: transform 0.1s ease, color 0.3s ease;
    text-decoration: none;
    /* For a tags */
}

.nav-btn:active {
    transform: scale(0.9);
}

.nav-btn.active {
    color: var(--pink-accent);
}

.nav-btn-primary {
    width: 3rem;
    height: 3rem;
    color: black;
    box-shadow: 0 10px 15px -3px rgba(6, 182, 212, 0.3);
}

.active-indicator {
    position: absolute;
    bottom: -0.25rem;
    width: 0.25rem;
    height: 0.25rem;
    background: var(--pink-accent);
    border-radius: 9999px;
    opacity: 0;
    transform: translateY(5px) scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn.active .active-indicator {
    opacity: 1;
    transform: translateY(0) scale(1);
    display: block;
    /* Ensure it's not hidden by inline styles if any residue remains, though script will clean this up */
}

/* 背景装飾 */
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    pointer-events: none;
    overflow: hidden;
}

.glow-1 {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: rgba(219, 39, 119, 0.2);
    filter: blur(100px);
    border-radius: 9999px;
}

.glow-2 {
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: rgba(8, 145, 178, 0.2);
    filter: blur(100px);
    border-radius: 9999px;
}

/* 検索セクション */
.search-form {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 9999px;
    margin-bottom: 2rem;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    flex: 1;
    font-size: 1rem;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-btn-submit {
    background: var(--pink-gradient);
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(219, 39, 119, 0.3);
}

.search-btn-submit:hover {
    transform: scale(1.05);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 3rem;
    /* nav bar space */
}

.category-btn:first-child {
    grid-column: span 2;
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 1rem;
    text-decoration: none;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.category-btn:active {
    transform: translateY(0);
}

/* フッターセクション */
.footer-section {
    padding: 0.5rem 1rem 4rem 1rem;
    /* Reduced padding */
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    display: grid;
    gap: 0.5rem;
}

.footer-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    transition: background 0.2s;
}

.footer-menu li a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.license-info {
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.75rem;
}

.license-info dl {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.5rem;
    margin: 0;
}

.license-info dt {
    font-weight: 700;
    color: var(--pink-accent);
}

.license-info dd {
    margin: 0;
    font-family: monospace;
}

.copyright {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.5;
}

/* ユーティリティ */
.bg-pink-500 {
    background-color: #ec4899;
}

.bg-yellow-400 {
    background-color: #facc15;
}

.bg-indigo-600 {
    background-color: #4f46e5;
}

.bg-cyan-400 {
    background-color: #22d3ee;
}

/* バナースライダー */
.banner-section {
    margin-bottom: 2rem;
}

.banner-container {
    width: 100%;
    overflow: hidden;
    border-radius: 1.5rem;
    position: relative;
    /* Necessary for absolute positioning if needed later */
}

.banner-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    /* Smooth transition for sliding */
    width: 100%;
    /* Will be adjusted by JS based on number of slides */
}

.banner-slide {
    min-width: 100%;
    /* Each slide takes full width */
    box-sizing: border-box;
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 1.5rem;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 1.5rem;
    /* Match container radius */
}

/* Inline Style Refactoring Utility Classes */

/* Header & Nav */
.header-icon-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.close-icon-svg,
.nav-icon-svg,
.search-btn-icon,
.section-icon {
    width: 20px;
    height: 20px;
}

/* User Menu */
.menu-item-icon {
    width: 16px;
    height: 16px;
}

/* Hero Section */
.hero-content {
    position: relative;
    z-index: 10;
}

.hero-btn-arrow {
    width: 18px;
    height: 18px;
}

.hero-bg-icon-svg {
    width: 120px;
    height: 120px;
}

/* Song Cards */
.song-thumb-img {
    width: 90%;
    height: 90%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 0.8rem;
}

.play-icon-svg {
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 2;
}

/* Search & Categories */
.category-arrow-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}