/* YouTube Thumbnail Downloader Tool Styles */

.url-input-container {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.url-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(64, 123, 255, 0.1);
}

.url-input.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.extract-btn {
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
    justify-content: center;
}

.extract-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 123, 255, 0.3);
}

.extract-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1.1rem;
}

.url-formats {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #bbdefb;
}

.url-formats p {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: #1976d2;
}

.url-formats ul {
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: none;
}

.url-formats li {
    margin-bottom: 0.25rem;
    color: #424242;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    position: relative;
}

.url-formats li::before {
    content: "✓";
    color: #4caf50;
    font-weight: bold;
    position: absolute;
    left: -1.2rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin-top: 1rem;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

.video-info-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.video-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.video-preview {
    width: 200px;
    height: 150px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e9ecef;
}

.video-details h4 {
    margin: 0 0 0.75rem 0;
    color: #333;
    font-size: 1.2rem;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.video-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-meta .meta-icon {
    width: 16px;
    text-align: center;
}

.thumbnails-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.download-controls {
    display: flex;
    gap: 1rem;
}

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

.thumbnail-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    text-align: center;
}

.thumbnail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.thumbnail-preview {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.thumbnail-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.thumbnail-info {
    margin-bottom: 1rem;
}

.quality-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.resolution-info {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.file-size {
    color: #28a745;
    font-size: 0.85rem;
    font-weight: 500;
}

.thumbnail-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.download-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.copy-url-btn {
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-url-btn:hover {
    background: #5a6268;
    transform: scale(1.05);
}

.batch-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.batch-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.batch-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    resize: vertical;
    background: #f8f9fa;
}

.batch-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(64, 123, 255, 0.1);
}

.batch-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.batch-results {
    margin-top: 1.5rem;
}

.batch-progress {
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.batch-progress-bar {
    background: linear-gradient(90deg, var(--primary-color), #0056b3);
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.batch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
}

.batch-item.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.batch-item.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.batch-item-url {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.batch-item-status {
    font-weight: 600;
    font-size: 0.9rem;
}

.history-section {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.history-thumbnail {
    width: 60px;
    height: 45px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid #ddd;
}

.history-details {
    flex: 1;
}

.history-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.history-url {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-timestamp {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
}

.quality-guide {
    margin-bottom: 2rem;
}

.quality-table {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.quality-header {
    display: grid;
    grid-template-columns: 1fr 120px 200px 100px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.quality-row {
    display: grid;
    grid-template-columns: 1fr 120px 200px 100px;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.quality-row:hover {
    background: #f8f9fa;
}

.quality-row:last-child {
    border-bottom: none;
}

.quality-name {
    font-weight: 600;
    color: var(--primary-color);
}

.quality-res {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    color: #333;
}

.quality-use {
    color: #6c757d;
    font-size: 0.9rem;
}

.quality-size {
    font-weight: 600;
    color: #28a745;
    text-align: center;
}

.importance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.importance-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.importance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.importance-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.importance-card p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #333;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-progress {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .quality-header,
    .quality-row {
        grid-template-columns: 1fr 100px 150px 80px;
    }
    
    .thumbnails-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
    
    .extract-btn {
        min-width: auto;
    }
    
    .video-info {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .video-preview {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .quality-header,
    .quality-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .quality-header {
        text-align: center;
    }
    
    .quality-row {
        text-align: left;
    }
    
    .quality-header > div:not(:first-child),
    .quality-row > div:not(:first-child) {
        font-size: 0.85rem;
    }
    
    .thumbnails-grid {
        grid-template-columns: 1fr;
    }
    
    .download-controls {
        flex-direction: column;
    }
    
    .batch-controls {
        flex-direction: column;
    }
    
    .history-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .history-timestamp {
        font-size: 0.75rem;
    }
    
    .importance-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .url-input-container {
        padding: 1rem;
    }
    
    .thumbnails-section,
    .batch-section,
    .history-section,
    .quality-guide,
    .why-matters,
    .how-to-use,
    .features-section,
    .faq-section,
    .examples-section,
    .video-info-section {
        padding: 1rem;
    }
    
    .thumbnail-actions {
        flex-direction: column;
    }
    
    .batch-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .batch-item-url {
        max-width: 100%;
    }
    
    .history-thumbnail {
        width: 80px;
        height: 60px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .section-header h2,
    .section-header h3 {
        font-size: 1.25rem;
    }
}

/* Dark mode support */
[data-theme="dark"] .url-input-container,
[data-theme="dark"] .video-info-section,
[data-theme="dark"] .thumbnails-section,
[data-theme="dark"] .batch-section,
[data-theme="dark"] .history-section,
[data-theme="dark"] .quality-guide,
[data-theme="dark"] .why-matters,
[data-theme="dark"] .quality-table,
[data-theme="dark"] .how-to-use,
[data-theme="dark"] .features-section,
[data-theme="dark"] .faq-section,
[data-theme="dark"] .examples-section {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .url-input,
[data-theme="dark"] .batch-textarea {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .url-input:focus,
[data-theme="dark"] .batch-textarea:focus {
    background: var(--bg-card);
    border-color: var(--border-focus);
}

[data-theme="dark"] .url-formats {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .url-formats p {
    color: var(--primary-color);
}

[data-theme="dark"] .url-formats li {
    color: var(--text-secondary);
}

[data-theme="dark"] .thumbnail-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .thumbnail-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
}

[data-theme="dark"] .history-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .history-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .batch-item {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .quality-row {
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .quality-row:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .quality-header {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .importance-card,
[data-theme="dark"] .step-card,
[data-theme="dark"] .feature-card,
[data-theme="dark"] .faq-item,
[data-theme="dark"] .example-card {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .importance-card:hover,
[data-theme="dark"] .step-card:hover,
[data-theme="dark"] .feature-card:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .video-details h4,
[data-theme="dark"] .quality-label,
[data-theme="dark"] .importance-card h3,
[data-theme="dark"] .step-card h3,
[data-theme="dark"] .feature-card h3,
[data-theme="dark"] .faq-item h3,
[data-theme="dark"] .example-card h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .video-meta,
[data-theme="dark"] .resolution-info,
[data-theme="dark"] .history-url,
[data-theme="dark"] .history-timestamp,
[data-theme="dark"] .batch-item-url {
    color: var(--text-secondary);
}

[data-theme="dark"] .loading-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-theme="dark"] .loading-text {
    color: var(--text-primary);
}

[data-theme="dark"] .loading-progress {
    color: var(--text-secondary);
}

[data-theme="dark"] .error-message {
    background: var(--error-color);
    color: var(--text-inverse);
    border-color: var(--error-color);
}

/* Base styles for sections */
.batch-section,
.history-section,
.quality-guide,
.why-matters,
.how-to-use,
.features-section,
.faq-section,
.examples-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.section-header h2,
.section-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
    margin: 0.25rem 0 0 0;
} 