/* Reel Downloader — style.css
   Prefijo --rd- para no pisar variables del tema activo */

.rd-wrap {
    --rd-accent:     #ff6b35;
    --rd-surface:    #ffffff;
    --rd-border:     #e2e2ea;
    --rd-text:       #1a1a2e;
    --rd-muted:      #6b6b8a;
    --rd-error:      #e53e3e;
    --rd-radius:     14px;
    --rd-font-mono:  'Courier New', Courier, monospace;

    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    font-family: inherit;
}

/* Input row */
.rd-input-row {
    display: flex;
    border: 1.5px solid var(--rd-border);
    border-radius: var(--rd-radius);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    background: var(--rd-surface);
}

.rd-input-row:focus-within {
    border-color: var(--rd-accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, .12);
}

.rd-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 18px;
    font-size: 14px;
    font-family: var(--rd-font-mono);
    color: var(--rd-text);
    background: transparent;
    min-width: 0;
}

.rd-input::placeholder { color: var(--rd-muted); }

.rd-btn-paste {
    flex-shrink: 0;
    background: none;
    border: none;
    border-left: 1px solid var(--rd-border);
    border-right: 1px solid var(--rd-border);
    padding: 0 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--rd-muted);
    cursor: pointer;
    transition: color .2s;
    white-space: nowrap;
}

.rd-btn-paste:hover { color: var(--rd-accent); }

.rd-btn-fetch {
    flex-shrink: 0;
    background: var(--rd-accent);
    border: none;
    padding: 0 24px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background .2s, transform .1s;
    white-space: nowrap;
}

.rd-btn-fetch:hover    { background: #e85a25; }
.rd-btn-fetch:active   { transform: scale(.97); }
.rd-btn-fetch:disabled { background: #b0b0b0; cursor: not-allowed; }

/* Hint */
.rd-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--rd-muted);
    font-family: var(--rd-font-mono);
    text-align: center;
}

/* Result */
.rd-result { margin-top: 24px; }

/* Loader */
.rd-loader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px;
    background: var(--rd-surface);
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
}

.rd-loader {
    width: 32px;
    height: 32px;
    border: 2px solid var(--rd-border);
    border-top-color: var(--rd-accent);
    border-radius: 50%;
    animation: rd-spin .7s linear infinite;
}

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

.rd-loader-text {
    font-size: 12px;
    color: var(--rd-muted);
    font-family: var(--rd-font-mono);
    letter-spacing: .1em;
}

/* Result card */
.rd-card {
    border: 1px solid var(--rd-border);
    border-radius: var(--rd-radius);
    overflow: hidden;
    background: var(--rd-surface);
    animation: rd-fadein .3s ease;
}

@keyframes rd-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rd-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #111;
    overflow: hidden;
}

.rd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .85;
}

.rd-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.rd-play-overlay svg {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,.5));
}

.rd-card-body { padding: 20px 24px 24px; }

.rd-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--rd-text);
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-card-desc {
    font-size: 12px;
    color: var(--rd-muted);
    font-family: var(--rd-font-mono);
    line-height: 1.6;
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rd-dl-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.rd-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--rd-accent);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none !important;
    transition: background .2s, transform .1s;
}

.rd-dl-btn:hover  { background: #e85a25; }
.rd-dl-btn:active { transform: scale(.97); }

.rd-dl-btn--ghost {
    background: transparent;
    border: 1px solid var(--rd-border);
    color: var(--rd-muted) !important;
}

.rd-dl-btn--ghost:hover { background: #f4f4f8; color: var(--rd-text) !important; }

/* Error */
.rd-error {
    background: rgba(229, 62, 62, .07);
    border: 1px solid rgba(229, 62, 62, .25);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 13px;
    color: var(--rd-error);
    line-height: 1.6;
    font-family: var(--rd-font-mono);
}

/* Responsive */
@media (max-width: 540px) {
    .rd-input-row { flex-direction: column; }
    .rd-btn-paste {
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--rd-border);
        padding: 12px;
    }
    .rd-btn-fetch { padding: 14px; justify-content: center; }
    .rd-thumb { aspect-ratio: 9/16; max-height: 300px; }
}

/* Spinner dentro del botón de descarga */
.rd-btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rd-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}

.rd-dl-btn:disabled {
    background: #c0550f;
    cursor: wait;
    opacity: 0.85;
}

/* Nota debajo de los botones */
.rd-dl-note {
    margin-top: 12px;
    font-size: 11px;
    color: var(--rd-muted);
    font-family: var(--rd-font-mono);
}

/* Spinner dentro del botón */
.rd-btn-spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rd-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
}

.rd-dl-btn--ghost .rd-btn-spinner {
    border-color: rgba(0,0,0,0.15);
    border-top-color: var(--rd-muted);
}

.rd-dl-btn:disabled {
    cursor: wait;
    opacity: 0.8;
}
