:root {
    --primary: #3a86ff;
    --accent: #ff006e;
    --dark-bg: #0f1014;
    --card-bg: #1a1c24;
    --text: #e0e1dd;
    --nav-bg: rgba(15, 16, 20, 0.98);
}
  
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    padding-top: 70px;
    background-color: var(--dark-bg);
    margin: 0;
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- HEADER --- */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    z-index: 1000;
    padding: 0 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-logo {
    height: 40px;
    object-fit: contain;
    cursor: pointer;
}

.header-icon {
    font-size: 20px;
    color: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

/* Search Bar Overlay */
.search-bar {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--dark-bg);
    display: none;
    align-items: center;
    padding: 0 15px;
    z-index: 1002;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    background: #252833;
    color: white;
    font-size: 16px;
    outline: none;
}

.search-bar button {
    background: none; border: none; color: white;
    font-size: 20px; margin-left: 10px; padding: 5px;
    cursor: pointer;
}

/* --- CONTAINER & GRID --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Grid Logic: Mobile (1 column), PC (4 columns) */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
    padding-bottom: 20px;
}

@media (min-width: 768px) {
    .movie-grid { 
        grid-template-columns: repeat(4, 1fr);
    }
}

/* --- MOVIE CARD (link to post page) --- */
.movie-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    width: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-thumbnail-container {
    position: relative;
    padding-top: 56.25%;
    width: 100%;
    background: #000;
}

.movie-thumbnail {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
}

.movie-info {
    padding: 12px;
    background: var(--card-bg);
}

.movie-title {
    font-size: 14px;
    margin: 0;
    color: #fff;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8em;
}

/* Stickers */
.sticker {
    position: absolute;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 2;
    color: white;
}
.rating-sticker { top: 8px; left: 8px; background: rgba(0,0,0,0.7); backdrop-filter: blur(2px); }
.quality-sticker { top: 8px; right: 8px; background: var(--primary); }
.season-sticker { top: 8px; right: 8px; background: var(--accent); }

/* --- INFINITE SCROLL LOADER --- */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
    width: 100%;
    grid-column: 1/-1;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.end-message {
    text-align: center;
    padding: 30px 0;
    color: #666;
    font-size: 14px;
    grid-column: 1/-1;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
}

/* --- MOVIE DETAIL PAGE (post) --- */
.movie-detail-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.movie-detail-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.movie-detail-poster {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    background: #000;
}

.movie-detail-info {
    padding: 25px;
}

.movie-detail-title {
    font-size: 28px;
    margin: 0 0 10px;
    color: #fff;
}

.movie-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    color: #aaa;
}

.movie-detail-description {
    line-height: 1.8;
    color: #ccc;
    margin: 20px 0;
}

/* Download Links Section - Centered */
.download-section {
    text-align: center;
    margin: 30px 0;
}

.download-title {
    font-size: 22px;
    border-bottom: 1px solid #333;
    padding-bottom: 12px;
    margin-bottom: 20px;
    color: #fff;
    text-align: left; /* Title left-aligned, buttons centered */
}

.detail-dl-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

@media (min-width: 600px) {
    .detail-dl-grid { 
        grid-template-columns: repeat(4, 1fr); 
    }
}

/* Related posts section */
.related-posts {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.related-title {
    font-size: 22px;
    margin-bottom: 20px;
    color: #fff;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

@media (min-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.dl-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 14px 8px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}
.dl-btn:hover { 
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
.dl-btn:active { 
    transform: scale(0.98); 
    background: var(--primary); 
}
.dl-btn i { 
    font-size: 18px; 
    margin-bottom: 3px; 
}

.q-480p { color: #66c7ff; border-color: #66c7ff; }
.q-720p { color: #06d6a0; border-color: #06d6a0; }
.q-1080p { color: #ffd166; border-color: #ffd166; }

.no-results {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
}

.top-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.top-btn {
    background: #252833;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-btn:hover {
    background: #3a3d4d;
}

.top-btn i {
    font-size: 16px;
}

/* Video player */
.video-container {
    width: 100%;
    background: #000;
}
.video-wrapper {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    position: relative;
}
.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}