:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --accent-color: #000000;
    --accent-text: #ffffff;
    --card-bg: #f9f9f9;
    --error-bg: #ffebee;
    --error-text: #c62828;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #f5f5f5;
        --text-muted: #a0a0a0;
        --border-color: #333333;
        --accent-color: #ffffff;
        --accent-text: #121212;
        --card-bg: #1e1e1e;
        --error-bg: #2c1a1a;
        --error-text: #ff8a80;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Ubuntu Mono', monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

header {
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 48px;
    color: var(--text-color);
    margin-bottom: 10px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 5px;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-box {
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-color);
    transition: border-color 0.3s;
}

.search-box:focus-within {
    border-color: var(--accent-color);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 15px;
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    width: 100%;
}

.btn-submit {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    background-color: #f97316;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.btn-submit:hover {
    opacity: 0.85;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

.loading {
    margin-top: 30px;
    color: var(--text-muted);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 10px auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-card {
    margin-top: 30px;
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid var(--error-text);
    text-align: left;
}

.result-card {
    margin-top: 40px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.result-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.video-info {
    padding: 20px;
}

.video-info h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    line-height: 1.2;
}

.uploader {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.uploader .material-icons {
    font-size: 18px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-grid p {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-grid .material-icons {
    font-size: 16px;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--accent-color);
    color: var(--accent-text);
    text-decoration: none;
    padding: 14px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    transition: opacity 0.2s;
}

.btn-download:hover {
    opacity: 0.9;
}