/* =====================================================
   YouTube Shorts Generator – Frontend Styles
   Dark cinematic theme
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --ytsg-bg:        #0a0a0f;
    --ytsg-surface:   #13131a;
    --ytsg-surface2:  #1c1c28;
    --ytsg-border:    #2a2a3a;
    --ytsg-red:       #ff2d2d;
    --ytsg-red-glow:  rgba(255,45,45,0.25);
    --ytsg-text:      #f0f0f8;
    --ytsg-muted:     #7a7a9a;
    --ytsg-accent:    #7b6fff;
    --ytsg-success:   #00e5a0;
    --ytsg-radius:    12px;
    --ytsg-radius-lg: 20px;
}

/* ---- Wrapper ---- */
.ytsg-wrapper {
    font-family: 'DM Sans', sans-serif;
    background: var(--ytsg-bg);
    color: var(--ytsg-text);
    padding: 40px 32px;
    border-radius: var(--ytsg-radius-lg);
    border: 1px solid var(--ytsg-border);
    max-width: 820px;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(123,111,255,0.08);
}

/* ---- Header ---- */
.ytsg-header {
    text-align: center;
    margin-bottom: 32px;
}

.ytsg-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ytsg-text);
}

.ytsg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--ytsg-red);
    border-radius: 8px;
    font-size: 16px;
    box-shadow: 0 0 20px var(--ytsg-red-glow);
}

.ytsg-tagline {
    color: var(--ytsg-muted);
    font-size: 14px;
    margin: 8px 0 0;
}

/* ---- Input Section ---- */
.ytsg-input-section {
    background: var(--ytsg-surface);
    border: 1px solid var(--ytsg-border);
    border-radius: var(--ytsg-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.ytsg-input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#ytsg-url-input {
    flex: 1;
    min-width: 200px;
    background: var(--ytsg-surface2);
    border: 1px solid var(--ytsg-border);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    color: var(--ytsg-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#ytsg-url-input:focus {
    border-color: var(--ytsg-accent);
    box-shadow: 0 0 0 3px rgba(123,111,255,0.15);
}

#ytsg-url-input::placeholder {
    color: var(--ytsg-muted);
}

.ytsg-hint {
    font-size: 12px;
    color: var(--ytsg-muted);
    margin: 10px 0 0;
}

/* ---- Buttons ---- */
.ytsg-btn {
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ytsg-btn-primary {
    background: var(--ytsg-red);
    color: #fff;
    box-shadow: 0 4px 20px var(--ytsg-red-glow);
}

.ytsg-btn-primary:hover:not(:disabled) {
    background: #ff1111;
    transform: translateY(-1px);
    box-shadow: 0 6px 28px var(--ytsg-red-glow);
}

.ytsg-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ytsg-btn-download {
    background: var(--ytsg-success);
    color: #0a0a0f;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 7px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
}

.ytsg-btn-download:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: #0a0a0f;
    text-decoration: none;
}

/* ---- Progress ---- */
.ytsg-progress-section {
    background: var(--ytsg-surface);
    border: 1px solid var(--ytsg-border);
    border-radius: var(--ytsg-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.ytsg-progress-bar {
    background: var(--ytsg-surface2);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ytsg-progress-fill {
    height: 100%;
    width: 15%;
    background: linear-gradient(90deg, var(--ytsg-accent), var(--ytsg-red));
    border-radius: 100px;
    animation: ytsg-progress-anim 2s ease-in-out infinite;
}

@keyframes ytsg-progress-anim {
    0%   { width: 10%; }
    50%  { width: 80%; }
    100% { width: 10%; }
}

.ytsg-progress-msg {
    color: var(--ytsg-muted);
    font-size: 13px;
    margin: 0;
    text-align: center;
}

/* ---- Error ---- */
.ytsg-error-box {
    background: rgba(255,45,45,0.08);
    border: 1px solid rgba(255,45,45,0.3);
    border-radius: var(--ytsg-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Results ---- */
.ytsg-results {
    margin-top: 10px;
}

.ytsg-results-heading {
    font-family: 'Space Mono', monospace;
    font-size: 16px;
    color: var(--ytsg-text);
    margin: 0 0 16px;
    border-bottom: 1px solid var(--ytsg-border);
    padding-bottom: 10px;
}

.ytsg-shorts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* ---- Short Card ---- */
.ytsg-short-card {
    background: var(--ytsg-surface);
    border: 1px solid var(--ytsg-border);
    border-radius: var(--ytsg-radius);
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.ytsg-short-card:hover {
    transform: translateY(-3px);
    border-color: var(--ytsg-accent);
}

.ytsg-short-thumb {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    background: var(--ytsg-surface2);
    display: block;
}

.ytsg-short-thumb-placeholder {
    width: 100%;
    aspect-ratio: 9/16;
    background: linear-gradient(135deg, var(--ytsg-surface2), var(--ytsg-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.ytsg-short-info {
    padding: 12px;
}

.ytsg-short-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--ytsg-accent);
    font-weight: 700;
    margin-bottom: 4px;
}

.ytsg-short-meta {
    font-size: 11px;
    color: var(--ytsg-muted);
    margin-bottom: 10px;
}

.ytsg-short-actions {
    display: flex;
    gap: 6px;
}

/* ---- Video Preview ---- */
.ytsg-short-video {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    display: block;
    background: #000;
}

/* ---- Responsive ---- */
@media (max-width: 500px) {
    .ytsg-wrapper {
        padding: 24px 16px;
    }
    .ytsg-input-row {
        flex-direction: column;
    }
    .ytsg-btn-primary {
        width: 100%;
        justify-content: center;
    }
}
