/* YouTube Thumbnail Downloader Styles */
.youtube-thumbnail-page {
    padding: 40px 0;
    background-color: #f9fafb;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Theme */
.dark-theme .youtube-thumbnail-page {
    background-color: #1a202c;
    color: #e2e8f0;
}

.dark-theme .tool-header h1,
.dark-theme .tool-header p,
.dark-theme .section-title,
.dark-theme .faq-question h3,
.dark-theme .thumbnail-item h4,
.dark-theme .video-info-card h3,
.dark-theme .video-info-card .channel-name,
.dark-theme .recent-video-title,
.dark-theme .recent-video-channel {
    color: #e2e8f0;
}

.dark-theme .card,
.dark-theme .tool-item,
.dark-theme .faq-item,
.dark-theme .video-info-card,
.dark-theme .recent-video-item {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dark-theme .btn {
    color: #fff;
}

.dark-theme .btn-primary {
    background-color: #4299e1;
    border-color: #4299e1;
}

.dark-theme .btn-secondary {
    background-color: #4a5568;
    border-color: #4a5568;
}

.dark-theme .form-control,
.dark-theme .form-control:focus {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dark-theme .form-control::placeholder {
    color: #a0aec0;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.tool-header h1 {
    font-size: 2.5rem;
    color: #1a365d;
    margin-bottom: 15px;
    font-weight: 700;
}

.tool-header .subtitle {
    font-size: 1.1rem;
    color: #4a5568;
    max-width: 800px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.breadcrumb {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #4299e1;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

.breadcrumb span {
    color: #4a5568;
}

/* Thumbnail Downloader */
.thumbnail-downloader {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    margin-bottom: 20px;
}

.input-group input[type="text"] {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.input-group .btn {
    border-radius: 0 8px 8px 0;
    padding: 0 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-panel {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.option-group {
    margin-bottom: 15px;
}

.thumbnail-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.option-item {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 1rem;
    text-decoration: none;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background-color: #4299e1;
    color: white;
}

.btn-primary:hover {
    background-color: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 24px;
    width: 24px;
    background-color: #fff;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #a0aec0;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #4299e1;
    border-color: #4299e1;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 8px;
    top: 4px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Result Container */
.result-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.result-container h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 20px;
}

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

.thumbnail-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.thumbnail-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.thumbnail-preview {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #f7fafc;
    overflow: hidden;
}

.thumbnail-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.thumbnail-preview:hover img {
    transform: scale(1.05);
}

.thumbnail-info {
    padding: 15px;
    border-top: 1px solid #edf2f7;
}

.thumbnail-info h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #2d3748;
}

.thumbnail-actions {
    display: flex;
    gap: 10px;
}

.thumbnail-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-actions .btn i {
    margin-right: 6px;
}

/* Error Container */
.error-container {
    margin-top: 20px;
    padding: 15px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    color: #e53e3e;
    display: none;
}

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

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading:after {
    content: "";
    position: absolute;
    top: calc(50% - 12px);
    right: 15px;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }
    
    .input-group input[type="text"] {
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .input-group .btn {
        border-radius: 8px;
        width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .thumbnail-options {
        grid-template-columns: 1fr;
    }
}

/* How It Works Section */
.how-it-works {
    margin: 60px 0;
    text-align: center;
}

.how-it-works h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 40px;
}

.steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.step {
    flex: 1;
    min-width: 250px;
    background: white;
    border-radius: 10px;
    padding: 30px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background-color: #4299e1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 20px;
}

.step-content h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.step-content p {
    color: #718096;
    line-height: 1.6;
}

/* Features Section */
.features-section {
    margin: 60px 0;
    text-align: center;
}

.features-section h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.features-section .section-subtitle {
    color: #718096;
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.feature {
    background: white;
    border-radius: 10px;
    padding: 30px 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background-color: #ebf8ff;
    color: #4299e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
}

.feature:hover .feature-icon {
    background-color: #4299e1;
    color: white;
    transform: scale(1.1);
}

.feature h3 {
    font-size: 1.3rem;
    color: #2d3748;
    margin-bottom: 15px;
}

.feature p {
    color: #718096;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* FAQ Section */
.faq-section {
    margin: 80px 0 60px;
    text-align: center;
}

.faq-section h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 40px;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.faq-item {
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.faq-question {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.faq-question:hover {
    background-color: #f8fafc;
}

.faq-question h3 {
    font-size: 1.1rem;
    color: #2d3748;
    margin: 0;
    font-weight: 600;
}

.faq-question i {
    color: #718096;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: #f8fafc;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 25px 20px;
}

.faq-answer p, .faq-answer ul {
    color: #4a5568;
    line-height: 1.7;
    margin: 0 0 15px;
}

.faq-answer ul {
    padding-left: 20px;
}

.faq-answer li {
    margin-bottom: 8px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #38a169;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 1000;
    max-width: 320px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: #e53e3e;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .thumbnail-downloader {
        padding: 20px 15px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .step {
        margin-bottom: 20px;
    }
    
    .faq-question h3 {
        font-size: 1rem;
        padding-right: 15px;
    }
    
    .toast {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}
