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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1117;
    color: #e5e7eb;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #1a1d27;
    border-bottom: 1px solid #2a2d3a;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f3f4f6;
}

.header-right {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: #6366f1; color: white; }
.btn-primary:hover { background: #818cf8; }
.btn-secondary { background: #374151; color: #d1d5db; }
.btn-secondary:hover { background: #4b5563; }
.btn-success { background: #059669; color: white; }
.btn-success:hover { background: #10b981; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #ef4444; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Controls bar */
.controls {
    padding: 12px 24px;
    background: #151720;
    border-bottom: 1px solid #2a2d3a;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.tab {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab:hover { color: #e5e7eb; background: #1f2937; }
.tab.active { background: #6366f1; color: white; }

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filter-input, .filter-select {
    padding: 7px 12px;
    border: 1px solid #374151;
    border-radius: 6px;
    background: #1f2937;
    color: #e5e7eb;
    font-size: 0.85rem;
}

.filter-input { flex: 1; min-width: 200px; }
.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: #6366f1;
}

.filter-select { min-width: 140px; }

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-text {
    margin-left: auto;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px 24px;
}

/* Card */
.card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1d27;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card.approved {
    border-color: #10b981;
}

.poster-wrap {
    position: relative;
    padding-top: 150%; /* 2:3 aspect ratio */
    background: #1f2937;
}

.poster-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
    padding: 12px;
}

.check-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.card.approved .check-badge { display: flex; }

.hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
}

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

.hover-text {
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.card:not(.approved) .hover-text {
    background: #059669;
}

.card:not(.approved) .hover-text::after { content: 'Approve'; }

.card.approved .hover-text {
    background: #dc2626;
}

.card.approved .hover-text::after { content: 'Remove'; }

.card-info {
    padding: 8px 10px 10px;
}

.card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #f3f4f6;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.card-year {
    font-size: 0.75rem;
    color: #9ca3af;
}

.rating-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: #374151;
    color: #d1d5db;
}

.rating-badge.G, .rating-badge.TV-Y, .rating-badge.TV-G { background: #065f46; color: #6ee7b7; }
.rating-badge.PG, .rating-badge.TV-Y7, .rating-badge.TV-PG { background: #1e40af; color: #93c5fd; }
.rating-badge.PG-13, .rating-badge.TV-14 { background: #92400e; color: #fcd34d; }
.rating-badge.R, .rating-badge.TV-MA { background: #991b1b; color: #fca5a5; }

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.1rem;
    color: #9ca3af;
}

.loading.hidden { display: none; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    background: #1f2937;
    color: #e5e7eb;
    font-size: 0.85rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #6366f1; }

/* Responsive */
@media (max-width: 768px) {
    .header { padding: 12px 16px; }
    .header h1 { font-size: 1.1rem; }
    .controls { padding: 10px 16px; }
    .filters { flex-direction: column; }
    .filter-input { min-width: unset; }
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
        padding: 16px;
    }
    .bulk-actions { flex-wrap: wrap; }
    .stats-text { width: 100%; margin-left: 0; margin-top: 4px; }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }
}
