/* Thumbnail Grabber Interface */
.thumbnail-grabber-interface {
    margin-bottom: 2rem;
}

.grabber-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.input-wrapper {
    width: 100%;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
}

.url-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex-wrap: wrap;
}

.url-input {
    flex: 1;
    min-width: 200px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
    outline: none;
}

.url-input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.url-input::placeholder {
    color: #9ca3af;
}

.grab-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 140px;
}

.grab-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.grab-button:active:not(:disabled) {
    transform: translateY(0);
}

.grab-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.input-hint {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Video Preview Card */
.video-preview-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-preview-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.video-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin: 0;
}

.video-meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-item {
    display: inline-flex;
    align-items: center;
}

.meta-divider {
    color: #d1d5db;
}

/* Loading animation for duration/views */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.loading-meta {
    animation: pulse 1.5s ease-in-out infinite;
    opacity: 0.8;
    font-style: italic;
}

/* Thumbnails Section */
.thumbnails-section {
    margin-top: 2rem;
    animation: fadeIn 0.3s ease;
}

.section-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.section-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Thumbnail Card */
.thumbnail-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.thumbnail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.thumbnail-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #f3f4f6;
    overflow: hidden;
}

.thumbnail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail-image-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #9ca3af;
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

.thumbnail-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.thumbnail-quality {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.thumbnail-resolution {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.thumbnail-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 1rem 1rem;
    flex-wrap: wrap;
}

.action-button {
    flex: 1;
    min-width: 100px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.download-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.download-button:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.copy-button {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.copy-button:hover {
    background: #e5e7eb;
    color: #111827;
}

.copy-button.copied {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
}

.action-button:active {
    transform: translateY(0);
}

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-content {
    flex: 1;
}

.error-title {
    font-size: 1rem;
    font-weight: 600;
    color: #991b1b;
    margin: 0 0 0.5rem 0;
}

.error-text {
    font-size: 0.875rem;
    color: #7f1d1d;
    margin: 0;
    line-height: 1.5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .grabber-card {
        padding: 1.5rem;
    }

    .url-input-group {
        flex-direction: column;
    }

    .url-input {
        width: 100%;
    }

    .grab-button {
        width: 100%;
    }

    .thumbnails-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .video-title {
        font-size: 1.125rem;
    }

    .thumbnail-actions {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .grabber-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .video-preview-card {
        padding: 1.25rem;
    }
}

/* Loading State */
.loading-shimmer {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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