/* CSS Reset & Custom Properties */
:root {
    --bg-color: #0b0d12;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.5);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --gradient-primary: linear-gradient(135deg, #8b5cf6, #3b82f6);
    --font-primary: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3 {
    font-weight: 800;
    letter-spacing: -0.5px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(11, 13, 18, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 6rem auto 2rem;
    padding: 0 2rem;
    width: 100%;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loader */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40vh;
    font-size: 1.5rem;
    color: var(--accent);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--card-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* View: Home */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

/* Cards */
.series-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.series-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.card-image-wrapper {
    width: 100%;
    height: 350px;
    overflow: hidden;
    position: relative;
    background: #1a1d24;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.series-card:hover .card-image {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 1rem 1rem;
    background: linear-gradient(to top, rgba(11, 13, 18, 1) 0%, rgba(11, 13, 18, 0) 100%);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* View: Detail */
.detail-view {
    display: flex;
    gap: 3rem;
    animation: fadeIn 0.4s ease;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 600;
    transition: color 0.3s;
}

.back-btn:hover {
    color: var(--accent);
}

.detail-image-container {
    flex: 0 0 350px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.detail-image {
    width: 100%;
    height: auto;
    display: block;
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.detail-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-pill {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-pill span {
    color: var(--accent);
}

.detail-synopsis {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.genres-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.genre-tag {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.read-btn {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    box-shadow: 0 10px 20px var(--accent-glow);
}

.read-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px var(--accent-glow);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .detail-view {
        flex-direction: column;
        gap: 2rem;
    }
    
    .detail-image-container {
        flex: 0 0 auto;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
}
