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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    margin-bottom: 40px;
}

h1 {
    color: #e50914;
    font-size: 2.5em;
    margin-bottom: 20px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#searchInput {
    flex: 1;
    min-width: 250px;
    padding: 12px 20px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 25px;
    color: white;
    font-size: 1em;
    transition: border-color 0.3s;
}

#searchInput:focus {
    outline: none;
    border-color: #e50914;
}

.admin-link {
    padding: 12px 24px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.3s;
}

.admin-link:hover {
    background: #555;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.video-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(229, 9, 20, 0.4);
}

.video-thumbnail {
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video-thumbnail::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s;
}

.video-card:hover .video-thumbnail::before {
    background: rgba(0, 0, 0, 0.1);
}

.play-icon {
    font-size: 4em;
    color: white;
    z-index: 1;
    opacity: 0.9;
    transition: transform 0.3s, opacity 0.3s;
}

.video-card:hover .play-icon {
    transform: scale(1.2);
    opacity: 1;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-meta {
    font-size: 0.9em;
    color: #999;
}

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

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #1a1a1a;
    width: 90%;
    max-width: 1200px;
    border-radius: 15px;
    overflow: hidden;
    animation: slideUp 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #333;
}

.modal-header h2 {
    color: #e50914;
    font-size: 1.5em;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.close-btn:hover {
    background: #333;
}

.modal-body {
    padding: 30px;
}

#videoPlayer {
    width: 100%;
    max-height: 70vh;
    background: #000;
    border-radius: 10px;
}

.subtitle-selector {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.subtitle-selector label {
    font-weight: bold;
    color: #ccc;
}

#subtitleSelect {
    flex: 1;
    padding: 10px;
    background: #2a2a2a;
    border: 2px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 1em;
    cursor: pointer;
}

#subtitleSelect:focus {
    outline: none;
    border-color: #e50914;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #999;
    display: none;
}

.loading.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

.empty-state a {
    color: #e50914;
    text-decoration: none;
    font-weight: bold;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .video-thumbnail {
        height: 220px;
    }

    .play-icon {
        font-size: 3em;
    }

    .modal-content {
        width: 95%;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .subtitle-selector {
        flex-direction: column;
        align-items: stretch;
    }
}
