:root {
    --bg-main: #0b0c10;
    --bg-card: rgba(22, 24, 33, 0.7);
    --bg-card-hover: rgba(30, 33, 45, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.18);
    
    --primary: #8b5cf6; /* violet-500 */
    --primary-glow: rgba(139, 92, 246, 0.4);
    --secondary: #ec4899; /* pink-500 */
    --secondary-glow: rgba(236, 72, 153, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --font-heading: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --card-shadow-hover: 0 12px 40px 0 rgba(139, 92, 246, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(17, 24, 39, 0.3) 0px, transparent 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(11, 12, 16, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo svg {
    width: 32px;
    height: 32px;
}

nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-color);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15));
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Card Grid */
.grid-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 2px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Movie Card */
.movie-card {
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    height: 100%;
}

.movie-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--card-shadow-hover);
}

.movie-img-container {
    position: relative;
    aspect-ratio: 2 / 3;
    width: 100%;
    overflow: hidden;
    background: #1f2937;
}

.movie-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.movie-card:hover .movie-img {
    transform: scale(1.05);
}

.movie-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(11, 12, 16, 0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
}

.movie-score {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.movie-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.movie-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    height: 2.8em;
}

.movie-card:hover .movie-title {
    color: var(--primary);
}

.movie-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

/* Keyword Cloud Section */
.kw-section {
    margin-bottom: 40px;
}

.kw-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.kw-tag {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    display: inline-block;
}

.kw-tag:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Footer & Friend Links */
footer {
    background: rgba(11, 12, 16, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 60px;
    font-size: 14px;
    color: var(--text-secondary);
}

.friend-links-box {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
    margin-bottom: 20px;
}

.friend-links-box h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.friend-links-box a {
    margin-right: 15px;
    margin-bottom: 10px;
    display: inline-block;
    color: var(--text-secondary);
}

.friend-links-box a:hover {
    color: var(--primary);
    text-shadow: 0 0 8px var(--primary-glow);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Detail Page specific */
.detail-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-top: 30px;
    margin-bottom: 40px;
}

.detail-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

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

.detail-main h1 {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.detail-meta-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.detail-meta-item {
    font-size: 14px;
}

.detail-meta-item span {
    color: var(--text-secondary);
    margin-right: 6px;
}

.detail-desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* Play Sections */
.playlist-section {
    margin-bottom: 30px;
}

.playlist-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.playlist-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.play-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 90px;
    text-align: center;
}

.play-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.play-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

/* Player layout */
.player-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

/* Pager */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 40px 0;
}

.page-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
}

.page-item:hover, .page-item.active {
    color: var(--text-primary);
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.page-item.active {
    background: var(--primary);
    border-color: var(--primary);
}

.page-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 992px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
    .detail-cover {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }
    
    nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }
    
    .movie-title {
        font-size: 13px;
    }
    
    .detail-meta-list {
        grid-template-columns: 1fr;
    }
}
