/* ========================================
   JULOFLIX - Modern Theme CSS
   Clean, Responsive, Functional
   ======================================== */

:root {
    /* Colors */
    --primary: #e50914;
    --primary-dark: #b20710;
    --bg-dark: #141414;
    --bg-card: #1f1f1f;
    --bg-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border: #333333;

    /* Spacing */
    --radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 80px;
    /* Space for mobile nav */
}

@media (min-width: 1024px) {
    body {
        padding-bottom: 0;
    }
}

/* ========================================
   HEADER
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    height: 70px;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -1px;
}

.nav-desktop {
    display: none;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .nav-desktop {
        display: flex;
    }
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-btn,
.user-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: background 0.3s;
}

.search-btn:hover {
    background: var(--bg-hover);
}

/* User Avatar Styles */
.user-btn {
    padding: 0;
    border-radius: 50%;
    position: relative;
}

.user-btn:hover {
    transform: scale(1.05);
    background: transparent;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    background: var(--bg-card);
    display: block;
}

.user-avatar-default {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.user-avatar-default svg {
    width: 24px;
    height: 24px;
}

/* ========================================
   MOBILE BOTTOM NAVIGATION
   ======================================== */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
    display: block;
}

@media (min-width: 1024px) {
    .mobile-nav {
        display: none;
    }
}

.mobile-nav-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.3s;
    font-size: 0.75rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav-item svg {
    width: 24px;
    height: 24px;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item:active {
    transform: scale(0.95);
}

/* ========================================
   CONTAINER
   ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-wrapper {
    margin-top: 90px;
    min-height: calc(100vh - 170px);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
    position: relative;
    height: 500px;
    margin-bottom: 3rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(20, 20, 20, 0.9) 0%, rgba(20, 20, 20, 0.3) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    max-width: 600px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Mobile Hero Responsiveness */
@media (max-width: 768px) {
    .hero {
        height: 400px;
    }

    .hero-content {
        padding: 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .hero-description {
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 350px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-description {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(229, 9, 20, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   SECTION
   ======================================== */
.section {
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.view-all {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: opacity 0.3s;
}

.view-all:hover {
    opacity: 0.8;
}

/* ========================================
   CONTENT GRID
   ======================================== */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .content-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1280px) {
    .content-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ========================================
   CONTENT CARD
   ======================================== */
.content-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s;
    cursor: pointer;
}

.content-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.card-poster {
    position: relative;
    width: 100%;
    padding-bottom: 150%;
    background: var(--bg-card);
}

.card-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.content-card:hover .card-overlay {
    opacity: 1;
}

.card-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.badge-type {
    background: rgba(229, 9, 20, 0.9);
}

.badge-audio {
    background: rgba(255, 255, 255, 0.2);
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   UTILITIES
   ======================================== */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-4 {
    gap: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* ========================================
   LOADING
   ======================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}