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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

header {
    background: #1a1a2e;
    padding: 1rem 2rem;
}

nav .logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
}

main {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Controls */
.controls { margin-bottom: 1.5rem; }
.filter-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-form select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95rem;
}

/* Video grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
}

.video-card {
    background: #fff;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.video-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.video-card-body { padding: 1.2rem; }
.video-card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.video-card p { color: #666; font-size: 0.9rem; margin-bottom: 0.8rem; }

.video-meta { display: flex; gap: 0.5rem; align-items: center; font-size: 0.85rem; }
.badge {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}
.date { color: #999; }

/* Video page */
.video-page video {
    border-radius: 10px;
    background: #000;
    margin-bottom: 1rem;
}
.video-page h1 { margin-bottom: 0.5rem; }
.video-page .description { margin: 1rem 0; color: #555; }
.back-link { color: #1a73e8; text-decoration: none; }

/* Login */
.login-form {
    max-width: 360px;
    margin: 4rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}
.login-form h2 { margin-bottom: 1rem; }
.login-form input, .login-form button {
    width: 100%;
    padding: 0.7rem;
    margin-bottom: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}
.login-form button {
    background: #1a73e8;
    color: #fff;
    border: none;
    cursor: pointer;
}
.error { color: #d32f2f; margin-bottom: 0.8rem; }

/* Admin */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.btn-logout { color: #999; text-decoration: none; }

.admin-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.admin-section h3 { margin-bottom: 1rem; }

.admin-section form input,
.admin-section form textarea,
.admin-section form select {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

.admin-section button {
    padding: 0.5rem 1.2rem;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-danger { background: #d32f2f !important; }

.inline-form { display: inline-flex; gap: 0.5rem; align-items: center; }

.category-list {
    list-style: none;
    margin-top: 0.8rem;
}
.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #eee;
}

.admin-video-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.8rem;
}
.admin-video-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.filename { color: #999; font-size: 0.85rem; }

.delete-form { margin-top: 0.5rem; text-align: right; }

.empty { color: #999; font-style: italic; padding: 2rem 0; text-align: center; }

/* Responsive */
@media (max-width: 600px) {
    .video-grid { grid-template-columns: 1fr; }
    main { padding: 0 0.5rem; }
    header { padding: 1rem; }
}
