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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #141414;
    color: #e5e5e5;
    min-height: 100vh;
}

a { color: #e5e5e5; text-decoration: none; }

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #e50914;
}

.nav-logo {
    height: 32px;
    width: auto;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.inline-form { display: inline; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary {
    background: #e50914;
    color: #fff;
}

.btn-primary:hover { background: #f40612; }

.btn-danger {
    background: #666;
    color: #fff;
}

.btn-danger:hover { background: #dc2626; }

.btn-ghost {
    background: transparent;
    color: #aaa;
    border: 1px solid #555;
}

.btn-ghost:hover { color: #fff; border-color: #fff; }

.btn-large { padding: 0.75rem 2rem; font-size: 1.1rem; }

/* Container */
.container { padding: 2rem; max-width: 1400px; margin: 0 auto; }

/* Search */
.search-bar {
    flex: 0 1 400px;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #555;
    background: #333;
    color: #fff;
    font-size: 0.95rem;
}

.search-input:focus { outline: none; border-color: #e50914; }

/* Card Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

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

.video-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.video-card a { display: block; }

.card-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.card-info { padding: 0.75rem; }

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

.card-description {
    font-size: 0.85rem;
    color: #999;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: #1a1a1a;
    padding: 2.5rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #aaa;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    border: 1px solid #555;
    background: #333;
    color: #fff;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #e50914;
}

.form-group textarea { resize: vertical; min-height: 100px; }

.form-error {
    color: #e50914;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* Detail Page */
.video-player {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 2rem;
}

.video-player video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.video-info { max-width: 1000px; margin: 0 auto; }

.video-info h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }

.video-meta {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.video-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #ccc;
    margin-bottom: 1.5rem;
}

.video-actions { display: flex; gap: 1rem; align-items: center; }

.back-link { color: #999; font-size: 0.9rem; }
.back-link:hover { color: #fff; }

/* Upload Page */
.upload-container { max-width: 600px; margin: 0 auto; }

.upload-container h1 { font-size: 1.6rem; margin-bottom: 1.5rem; }

.upload-progress {
    display: none;
    margin-top: 1rem;
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #e50914;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #999;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 0.75rem 1rem; }
    .container { padding: 1rem; }
    .search-bar { flex: 1; margin: 0 0.5rem; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
}

@media (max-width: 480px) {
    .video-grid { grid-template-columns: 1fr; }
    .nav-brand { font-size: 1.1rem; }
}
