/* Reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #222;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (desktop) */
.sidebar {
    width: 280px;
    background: grey;
    color: #ecf0f1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.search-box input {
    width: 100%;
    padding: 0.6rem;
    border: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.7rem;
}

.search-box button, .clear-btn {
    background: #e67e22;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
}

.clear-btn {
    background: #95a5a6;
    margin-left: 0.5rem;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 2rem;
}

/* Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.content-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.content-link {
    text-decoration: none;
}

.content-card:hover {
    transform: translateY(-4px);
}

.card-cover img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    cursor: pointer;
}

.content-card:hover .card-cover-overlay {
    opacity: 1;
}

.card-cover-overlay {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.watch-button {
    color: white;
    font-weight: 600;
    background: var(--accent-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
}

.card-info {
    padding: 0.8rem;
}

.card-info h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.rating {
    font-size: 0.85rem;
    color: #f39c12;
}

/* Tags */
.tag {
    display: inline-block;
    background: #e0e0e0;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-right: 0.3rem;
    margin-bottom: 0.3rem;
}

.tag-genre { background: #3498db; color: white; }
.tag-staff { background: #9b59b6; color: white; }
.tag-content_type { background: #1abc9c; color: white; }
.tag-mythology { background: #e67e22; color: white; }

/* Detail page */
.detail-container {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.detail-cover {
    flex: 0 0 300px;
}

.detail-cover img {
    width: 100%;
    border-radius: 12px;
    cursor: pointer;
}

.detail-info {
    flex: 1;
}

.description {
    line-height: 1.5;
    margin-bottom: 1rem;
}

.metadata {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.tag-group {
    margin-bottom: 1.2rem;
}

.tag-group h4 {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: #2c3e50;
}

.link-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.link-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    color: #2c3e50;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    margin: 5% auto;
    width: 80%;
    max-width: 900px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 1001;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
    background: rgba(0,0,0,0.8);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
    text-align: center;
}

.pagination a {
    background: #3498db;
    color: white;
    padding: 0.4rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    margin: 0 0.5rem;
}

/* Mobile: sidebar on bottom */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        z-index: 100;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.8rem;
        gap: 1rem;
    }
    .search-box {
        flex: 1;
    }
    .main-content {
        margin-bottom: 80px;
    }
}
