/* YouTube Thumbnail Downloader - Fully Responsive */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ====================== YOUTUBE THUMBNAIL DOWNLOADER STYLES ====================== */

.ytthumb-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    font-family: 'Poppins', sans-serif;
}

.ytthumb-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.ytthumb-title {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
}

.ytthumb-icon {
    font-size: 2.8rem;
    display: inline-block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.ytthumb-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.ytthumb-card {
    background: var(--surface);
    border-radius: var(--radius, 16px);
    border: 1px solid var(--border);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Input Area */
.input-area {
    margin-bottom: 1.5rem;
}

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

.yt-input {
    flex: 1;
    padding: 1rem 1.2rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s;
}

.yt-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.fetch-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.fetch-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.3);
}

.fetch-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.input-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Preview Area */
.preview-area {
    margin-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

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

.video-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.main-thumbnail {
    width: 200px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.main-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.video-details {
    flex: 1;
}

.video-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.video-channel {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Quality Section */
.quality-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

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

.quality-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

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

.quality-preview {
    position: relative;
    background: var(--surface);
}

.quality-preview img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.quality-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.quality-info {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.quality-size {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.download-quality-btn {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.download-quality-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Action Buttons */
.ytthumb-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.ytthumb-action-btn {
    padding: 0.7rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.ytthumb-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Tips Section */
.ytthumb-tips {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(139, 92, 246, 0.1));
    padding: 1.5rem;
    border-radius: 16px;
    margin: 2rem 0;
    text-align: center;
    border: 1px solid rgba(255, 0, 0, 0.2);
}

.ytthumb-tips h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.ytthumb-tips p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* SEO Section */
.ytthumb-seo {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.ytthumb-seo h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.ytthumb-seo h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem;
    color: var(--text);
}

.ytthumb-seo p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.ytthumb-howto-list,
.ytthumb-features-list {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.ytthumb-howto-list li,
.ytthumb-features-list li {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.ytthumb-features-list {
    list-style: none;
    padding: 0;
}

.ytthumb-features-list li {
    padding-left: 1.5rem;
    position: relative;
}

.ytthumb-features-list li::before {
    content: '✓';
    color: #ff0000;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Message Notifications */
.ytthumb-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.ytthumb-message-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.ytthumb-message-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.ytthumb-message-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ====================== RESPONSIVE DESIGN ====================== */

/* Tablet Styles */
@media screen and (max-width: 1024px) {
    .ytthumb-container {
        padding: 0 1.5rem;
        margin: 1.5rem auto;
    }

    .ytthumb-title {
        font-size: 2.5rem;
    }

    .ytthumb-icon {
        font-size: 2.3rem;
    }

    .ytthumb-card {
        padding: 1.5rem;
    }

    .quality-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Mobile Landscape & Tablet Portrait */
@media screen and (max-width: 768px) {
    .ytthumb-container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .ytthumb-title {
        font-size: 2rem;
    }

    .ytthumb-icon {
        font-size: 1.8rem;
    }

    .ytthumb-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .ytthumb-card {
        padding: 1.2rem;
    }

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

    .fetch-button {
        width: 100%;
        padding: 0.9rem;
    }

    .video-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .main-thumbnail {
        width: 100%;
        max-width: 300px;
    }

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

    .quality-grid {
        grid-template-columns: 1fr;
    }

    .quality-card {
        max-width: 100%;
    }

    .ytthumb-tips {
        padding: 1rem;
    }

    .ytthumb-tips h3 {
        font-size: 1rem;
    }

    .ytthumb-tips p {
        font-size: 0.85rem;
    }

    .ytthumb-seo {
        padding: 1.5rem;
    }

    .ytthumb-seo h2 {
        font-size: 1.5rem;
    }

    .ytthumb-seo h3 {
        font-size: 1.1rem;
    }

    .ytthumb-seo p,
    .ytthumb-howto-list li,
    .ytthumb-features-list li {
        font-size: 0.9rem;
    }
}

/* Mobile Portrait */
@media screen and (max-width: 480px) {
    .ytthumb-container {
        padding: 0 0.75rem;
        margin: 0.75rem auto;
    }

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

    .ytthumb-icon {
        font-size: 1.3rem;
    }

    .ytthumb-subtitle {
        font-size: 0.85rem;
    }

    .ytthumb-card {
        padding: 1rem;
    }

    .yt-input {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .fetch-button {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .quality-info {
        flex-direction: column;
        align-items: stretch;
    }

    .download-quality-btn {
        justify-content: center;
    }

    .ytthumb-seo h2 {
        font-size: 1.2rem;
    }

    .ytthumb-seo h3 {
        font-size: 1rem;
    }

    .ytthumb-seo p,
    .ytthumb-howto-list li,
    .ytthumb-features-list li {
        font-size: 0.85rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .fetch-button,
    .download-quality-btn,
    .ytthumb-action-btn {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .fetch-button:active,
    .download-quality-btn:active {
        transform: scale(0.98);
    }
}

/* Print styles */
@media print {
    .fetch-button,
    .ytthumb-actions,
    .quality-section .download-quality-btn {
        display: none;
    }

    .ytthumb-container {
        padding: 0;
        margin: 0;
    }

    .ytthumb-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
}

/* Scrollbar styling */
.yt-input::-webkit-scrollbar,
.quality-grid::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.yt-input::-webkit-scrollbar-track,
.quality-grid::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 4px;
}

.yt-input::-webkit-scrollbar-thumb,
.quality-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* ====================== SEO CONTENT STYLES ====================== */

.ytthumb-seo-content {
    margin: 3rem auto;
    max-width: 1000px;
    padding: 0 1.5rem;
}

.seo-wrapper {
    background: var(--surface);
    border-radius: var(--radius, 16px);
    border: 1px solid var(--border);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.seo-article h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.seo-article h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.seo-article h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
    margin: 1.5rem 0 1rem;
}

.seo-article p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.seo-article ul,
.seo-article ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.seo-article li {
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.seo-article li strong {
    color: var(--text);
}

/* Feature List */
.seo-feature-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.seo-feature-list li {
    background: var(--bg);
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    margin-bottom: 0;
}

/* Step List */
.seo-step-list {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 16px;
    list-style: none;
    counter-reset: step;
}

.seo-step-list li {
    counter-increment: step;
    padding-left: 2.5rem;
    position: relative;
    margin-bottom: 1rem;
}

.seo-step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Quality Grid */
.seo-quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.quality-info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s;
}

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

.quality-info-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.quality-info-card p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* User Cases */
.seo-user-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.user-case {
    background: var(--bg);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.user-case:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.user-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.user-case h3 {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: var(--text);
}

.user-case p {
    font-size: 0.9rem;
    margin: 0;
}

/* Code Block */
.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    overflow-x: auto;
    margin: 1rem 0;
}

/* FAQ Section */
.seo-faq {
    margin: 1.5rem 0;
}

.faq-item {
    background: var(--bg);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.faq-item h3 {
    padding: 1rem 1.5rem;
    margin: 0;
    background: var(--surface);
    cursor: pointer;
    font-size: 1rem;
}

.faq-item p {
    padding: 0 1.5rem 1rem 1.5rem;
    margin: 0;
    display: block;
}

/* Related Articles */
.seo-related {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.seo-related h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
}

.seo-related ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    padding: 0;
}

.seo-related a {
    color: var(--primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-radius: 30px;
    transition: all 0.3s;
    display: inline-block;
}

.seo-related a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ====================== RESPONSIVE SEO STYLES ====================== */

@media screen and (max-width: 768px) {
    .ytthumb-seo-content {
        padding: 0 1rem;
        margin: 2rem auto;
    }

    .seo-wrapper {
        padding: 1.5rem;
    }

    .seo-article h1 {
        font-size: 1.5rem;
    }

    .seo-article h2 {
        font-size: 1.3rem;
    }

    .seo-article h3 {
        font-size: 1.1rem;
    }

    .seo-feature-list {
        grid-template-columns: 1fr;
    }

    .seo-quality-grid {
        grid-template-columns: 1fr;
    }

    .seo-user-cases {
        grid-template-columns: 1fr;
    }

    .code-block {
        font-size: 0.8rem;
    }

    .faq-item h3 {
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
    }

    .faq-item p {
        font-size: 0.85rem;
        padding: 0 1rem 0.8rem 1rem;
    }
}

@media screen and (max-width: 480px) {
    .seo-wrapper {
        padding: 1rem;
    }

    .seo-article h1 {
        font-size: 1.3rem;
    }

    .seo-article h2 {
        font-size: 1.1rem;
    }

    .seo-article h3 {
        font-size: 1rem;
    }

    .seo-related ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .seo-related a {
        text-align: center;
        width: 100%;
    }
}