/* YouTube Thumbnail Downloader Specific CSS */

.thumbnail-input-section {
    /* No max-width restriction here, let the inner elements handle it */
    margin: 0 auto;
    max-width: 500px;
    width: 100%;
    /* background: var(--bg-card); removed to match SEO Analyzer cleaner look if needed, but keeping for container */
}

/* Match SEO Analyzer form layout */
.form-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.tool-card-specific .tool-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background-color: var(--tool-card-bg);
    color: var(--dark-text);
    font-size: 16px;
    transition: var(--transition);
    margin-bottom: 12px;
    text-align: center;
    /* SEO Analyzer often centers text input or keeps left. Left is better for URLs. */
    text-align: left;
}

/* Button Wrapper */
.btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    width: 100%;
}

.btn-primary {
    padding: 12px 30px;
    /* Bigger button */
    font-size: 1.1em;
}


/* Results Grid */
.thumbnails-results {
    display: none;
    /* Hidden by default */
    margin-top: 3rem;
    text-align: center;
}

.thumbnails-results h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-text);
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

@media (min-width: 768px) {
    .thumbnails-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.thumbnail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumbnail-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.thumb-preview {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    overflow: hidden;
}

.thumb-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-info {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.thumb-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thumb-res {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
}

.thumb-size-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.download-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.download-link:hover {
    background: var(--primary-color);
    color: white;
}

.download-link.primary {
    background: var(--primary-color);
    color: white;
}

.download-link.primary:hover {
    background: var(--primary-hover);
}

/* Error State */
.error-message {
    display: none;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: var(--border-radius-md);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    max-width: 60%;
    margin-left: auto;
    margin-right: auto;
}

.dark .error-message {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.loader {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive adjustments */
@media (max-width: 600px) {
    .tool-card-specific .tool-input {
        width: 100%;
    }

    .error-message {
        max-width: 100%;
    }
}