/* YT-DLP Downloader – Frontend Styles */
:root {
    --ytdlp-primary:   #ff0000;
    --ytdlp-success:   #28a745;
    --ytdlp-bg:        #ffffff;
    --ytdlp-border:    #dee2e6;
    --ytdlp-text:      #212529;
    --ytdlp-muted:     #6c757d;
    --ytdlp-radius:    8px;
    --ytdlp-shadow:    0 2px 12px rgba(0,0,0,.08);
}

.ytdlp-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--ytdlp-bg);
    border: 1px solid var(--ytdlp-border);
    border-radius: var(--ytdlp-radius);
    box-shadow: var(--ytdlp-shadow);
    padding: 24px;
    max-width: 720px;
    margin: 0 auto 24px;
    color: var(--ytdlp-text);
}

/* Dark theme */
.ytdlp-dark {
    --ytdlp-bg:     #1a1a2e;
    --ytdlp-border: #444;
    --ytdlp-text:   #e0e0e0;
    --ytdlp-muted:  #aaa;
}

.ytdlp-title {
    margin: 0 0 16px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ytdlp-primary);
}

/* Input row */
.ytdlp-input-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ytdlp-url-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid var(--ytdlp-border);
    border-radius: var(--ytdlp-radius);
    font-size: .95rem;
    background: var(--ytdlp-bg);
    color: var(--ytdlp-text);
    outline: none;
    transition: border-color .2s;
}
.ytdlp-url-input:focus { border-color: var(--ytdlp-primary); }

/* Buttons */
.ytdlp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--ytdlp-radius);
    cursor: pointer;
    font-size: .95rem;
    font-weight: 600;
    transition: opacity .15s, transform .1s;
    text-decoration: none;
}
.ytdlp-btn:hover   { opacity: .88; }
.ytdlp-btn:active  { transform: scale(.97); }
.ytdlp-btn-primary { background: var(--ytdlp-primary); color: #fff; }
.ytdlp-btn-success { background: var(--ytdlp-success); color: #fff; }
.ytdlp-btn-full    { width: 100%; margin-top: 12px; }

/* Status */
.ytdlp-status {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: var(--ytdlp-radius);
    font-size: .9rem;
}
.ytdlp-status.is-error   { background: #fff0f0; color: #c0392b; border: 1px solid #f5c6cb; }
.ytdlp-status.is-loading { background: #fffbe6; color: #856404; border: 1px solid #ffe083; }
.ytdlp-dark .ytdlp-status.is-error   { background: #3a1515; }
.ytdlp-dark .ytdlp-status.is-loading { background: #2e2a10; }

/* Info panel */
.ytdlp-info-panel {
    margin-top: 18px;
    animation: ytdlp-fade-in .3s ease;
}

.ytdlp-media {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}
.ytdlp-thumb {
    width: 140px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #ddd;
}
.ytdlp-meta { flex: 1; min-width: 0; }
.ytdlp-video-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.ytdlp-video-meta {
    display: block;
    font-size: .85rem;
    color: var(--ytdlp-muted);
}

/* Options row */
.ytdlp-options-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.ytdlp-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 140px;
}
.ytdlp-field label { font-size: .85rem; font-weight: 600; color: var(--ytdlp-muted); }
.ytdlp-select {
    padding: 8px 12px;
    border: 1px solid var(--ytdlp-border);
    border-radius: var(--ytdlp-radius);
    font-size: .9rem;
    background: var(--ytdlp-bg);
    color: var(--ytdlp-text);
    cursor: pointer;
}

/* Progress */
.ytdlp-progress-wrap { margin-top: 16px; text-align: center; }
.ytdlp-progress-bar  {
    background: var(--ytdlp-border);
    border-radius: 100px;
    height: 8px;
    overflow: hidden;
}
.ytdlp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ytdlp-primary), #ff6b6b);
    width: 0%;
    border-radius: 100px;
    animation: ytdlp-progress 3s ease-in-out forwards;
}
.ytdlp-progress-label { margin-top: 8px; font-size: .85rem; color: var(--ytdlp-muted); }

/* Result */
.ytdlp-result { margin-top: 16px; text-align: center; animation: ytdlp-fade-in .3s ease; }
.ytdlp-filesize { display: block; margin-top: 6px; color: var(--ytdlp-muted); font-size: .85rem; }

.ytdlp-notice { color: var(--ytdlp-muted); font-style: italic; }

@keyframes ytdlp-fade-in  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ytdlp-progress { 0% { width: 0%; } 30% { width: 40%; } 80% { width: 75%; } 100% { width: 90%; } }
