/* ==========================================================================
   YOUTUBE THUMBNAIL DOWNLOADER STYLESHEET (SCOPE-ISOLATED)
   ========================================================================== */

.yt-downloader-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Empty placeholder visual state */
.yt-empty-state {
    text-align: center;
    padding: 32px 16px;
    background-color: #f8fafc;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    margin-top: 8px;
    transition: var(--transition-base);
}

.yt-empty-icon {
    font-size: 40px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-bottom: 12px;
}

.yt-supported-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.yt-supported-badge {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}

/* Validation error block styles */
.yt-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.yt-error-feedback {
    display: none;
    font-size: 13px;
    font-weight: 500;
    color: #ef4444;
    margin-top: 6px;
}

/* Silent Shimmer Loading Skeleton */
.yt-skeleton-card {
    display: none;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-top: 24px;
    overflow: hidden;
}

.yt-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: yt-shimmer-pulse 1.5s infinite linear;
    border-radius: 6px;
}

@keyframes yt-shimmer-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.yt-skeleton-meta {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.yt-skeleton-submeta {
    height: 16px;
    width: 35%;
    margin-bottom: 20px;
}

.yt-skeleton-preview {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    margin-bottom: 24px;
}

.yt-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.yt-skeleton-grid-item {
    height: 180px;
    border-radius: 8px;
}

/* Video info preview box */
.yt-meta-card {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.yt-meta-icon {
    font-size: 24px;
    color: #ef4444;
}

.yt-video-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.yt-channel-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
}

/* Quality selections grid list */
.yt-quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.yt-quality-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    display: flex;
    flex-direction: column;
}

.yt-quality-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.yt-quality-thumb-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    background-color: #e2e8f0;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    position: relative;
}

.yt-quality-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-quality-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background-color: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.yt-quality-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px 0;
}

.yt-quality-resolution {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

.yt-quality-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Tactile button loading and success visual states */
.btn-check-success {
    background-color: #10b981 !important;
    border-color: #10b981 !important;
    color: #ffffff !important;
}

/* Accessibility Focus Outline styling overrides */
.yt-downloader-container a:focus-visible,
.yt-downloader-container button:focus-visible,
.yt-downloader-container input:focus-visible {
    outline: 3px solid var(--primary) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25) !important;
}

/* Mobile viewport adjustments */
@media (max-width: 480px) {
    .yt-empty-state {
        padding: 24px 12px;
    }
    .yt-supported-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    .yt-quality-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .yt-quality-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .yt-quality-actions button,
    .yt-quality-actions a {
        flex: 1 1 calc(50% - 4px);
        min-height: 38px;
        font-size: 12px !important;
        padding: 4px 6px !important;
    }
    .yt-quality-actions a[id^="directDl"] {
        flex: 1 1 100%;
        min-height: 38px;
    }
}
