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

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

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

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
}

header p {
    color: #666;
    margin-top: 6px;
}

.top-nav {
    position: absolute;
    top: 0;
    right: 0;
}

.top-nav a {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

.top-nav a:hover {
    background: #f0f0f0;
}

.login-card {
    max-width: 380px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.login-card label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: #333;
}

.login-card input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 12px;
    background: #fff;
}

.login-card input:focus {
    outline: none;
    border-color: #4a90d9;
}

.login-card button {
    width: 100%;
    padding: 12px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-card button:hover {
    background: #3a7bc8;
}

.login-card button:disabled {
    background: #a0c4e8;
    cursor: not-allowed;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.input-section input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.2s;
}

.input-section input:focus {
    outline: none;
    border-color: #4a90d9;
}

.input-section button {
    padding: 14px 28px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.input-section button:hover {
    background: #3a7bc8;
}

.input-section button:disabled {
    background: #a0c4e8;
    cursor: not-allowed;
}

.loader {
    display: none;
    text-align: center;
    padding: 40px;
}

.loader.active {
    display: block;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #4a90d9;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader p {
    color: #666;
}

.error {
    display: none;
    background: #fff0f0;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 14px 18px;
    color: #c62828;
    margin-bottom: 20px;
}

.error.active {
    display: block;
}

.player-section {
    display: none;
}

.player-section.active {
    display: block;
}

.video-wrapper {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    position: relative;
}

.video-wrapper video {
    width: 100%;
    display: block;
    max-height: 506px;
}

.metadata {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.metadata h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
}

.metadata .channel {
    color: #555;
    font-size: 0.9rem;
}

.metadata .details {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    color: #888;
    font-size: 0.85rem;
}

.actions {
    display: flex;
    gap: 10px;
}

.actions button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    transition: background 0.2s;
}

.actions button:hover {
    background: #f0f0f0;
}

.actions .download-btn {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

.actions .download-btn:hover {
    background: #3a7bc8;
}

.sb-badge {
    display: inline-block;
    background: #4caf50;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

footer {
    text-align: center;
    margin-top: 50px;
    color: #aaa;
    font-size: 0.8rem;
}
