/*
Theme Name: ThumbGrab Pro
Theme URI: https://mroman.dev
Author: Mohammad Roman
Author URI: https://mroman.dev
Description: A lightning fast, security-hardened, fully dynamic YouTube Thumbnail Downloader theme.
Version: 1.0.1
Text Domain: thumbgrab
*/

/* Design System Variables - Cyber Midnight Theme */
:root {
    /* Deep Space Backgrounds */
    --bg-dark: #030712;
    --bg-panel: rgba(17, 24, 39, 0.7);
    
    /* Neon Accents */
    --primary: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899; /* Pink */
    --secondary-glow: rgba(236, 72, 153, 0.4);
    --cyan: #06b6d4;
    --cyan-glow: rgba(6, 182, 212, 0.4);
    
    /* Text & UI */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
    
    --radius-lg: 1.5rem;
    --radius-md: 1rem;
    
    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Accessibility Utilities */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    /* Dynamic Background */
    background: radial-gradient(circle at top left, #1e1b4b, transparent 40%),
                radial-gradient(circle at bottom right, #310b2a, transparent 40%),
                #030712;
    background-attachment: fixed;
}

/* Animated Mesh Background */
.background-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    animation: meshMove 100s linear infinite;
}

@keyframes meshMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
}

/* Header - Frosted Glass */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 5rem;
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.header-content {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.header-logo:hover .logo-icon {
    background: var(--primary-glow);
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.logo-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.icon-youtube {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--text-main);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-social {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.social-link {
    color: var(--text-muted);
    padding: 0.6rem;
    border-radius: 10px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.social-link:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    padding-top: 8rem;
    padding-bottom: 4rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 5rem;
    position: relative;
}

.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--primary), var(--secondary), var(--cyan), var(--primary));
    background-size: 300% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to { background-position: 300% center; }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Input Section - Glowing Interface */
.input-section {
    max-width: 850px;
    margin: 0 auto 4rem;
    padding: 6px;
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.5);
    display: flex;
    gap: 8px;
    position: relative;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.input-section:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: scale(1.01);
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.input-field {
    width: 100%;
    height: 4rem;
    padding: 0 3.5rem 0 1.5rem;
    background: rgba(0,0,0,0.3);
    border: none;
    border-radius: calc(var(--radius-lg) - 6px);
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.input-field:focus { outline: none; background: rgba(0,0,0,0.5); }
.input-field::placeholder { color: var(--text-muted); opacity: 0.6; }

.clear-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) rotate(90deg);
}

.fetch-btn {
    height: 4rem;
    padding: 0 3rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: calc(var(--radius-lg) - 6px);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fetch-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.fetch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--secondary-glow);
}

.fetch-btn:hover::after { left: 100%; }
.fetch-btn:active { transform: scale(0.98); }

/* Ad Spaces - Clean & Minimal (Animation Removed) */
.ad-space-container {
    width: 100%;
    max-width: 900px;
    margin: 4rem auto;
    position: relative;
    min-height: 10px;
    text-align: center;
}

.ad-placeholder {
    width: 100%;
    height: 140px;
    background: rgba(255,255,255,0.01);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Animation removed per request */
.ad-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    z-index: 2;
}

/* Thumbnails Grid */
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-bottom: 5rem;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.thumbnail-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
}

.thumbnail-card:hover {
    border-color: var(--primary);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6), 0 0 20px var(--primary-glow);
    z-index: 10;
}

.thumbnail-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.thumbnail-card:hover .thumbnail-image { transform: scale(1.1); }

.thumbnail-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.03));
}

.thumbnail-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.thumbnail-quality {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
}

.thumbnail-size {
    font-size: 0.75rem;
    color: var(--cyan);
    font-weight: 600;
    background: rgba(6, 182, 212, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.download-btn {
    width: 100%;
    height: 3rem;
    margin-top: auto;
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-btn:hover {
    background: var(--text-main);
    color: var(--bg-dark);
    transform: scale(1.02);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 6rem 1rem;
    color: var(--text-muted);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.01);
    max-width: 800px;
    margin: 0 auto;
}

/* About Section */
.about-section { margin-bottom: 8rem; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; }
.section-subtitle { color: var(--text-muted); font-size: 1.1rem; }

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.about-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    text-align: center;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.about-card:hover {
    background: rgba(255,255,255,0.04);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.about-icon {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    border: 1px solid var(--border);
    animation: float 6s ease-in-out infinite;
}

.about-card:hover .about-icon {
    color: var(--text-main);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 10px 30px var(--primary-glow);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.about-card-title { font-weight: 700; margin-bottom: 1rem; font-size: 1.25rem; }
.about-card-text { color: var(--text-muted); font-size: 0.95rem; }

/* SEO Content */
.seo-content-section {
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-lg);
    padding: 4rem;
    border: 1px solid var(--border);
    margin-bottom: 6rem;
}

.seo-article h2 { font-size: 2rem; font-weight: 800; color: var(--text-main); margin-bottom: 2rem; }
.seo-article h3 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin-top: 2rem; margin-bottom: 1rem; }
.seo-article p { color: var(--text-muted); margin-bottom: 1.5rem; }
.seo-article ul { color: var(--text-muted); padding-left: 1.5rem; margin-bottom: 1.5rem; }
.seo-article li { margin-bottom: 0.5rem; }

/* Accordion */
.accordion-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: 0.3s;
    padding: 0 1.5rem;
}

/* Accessibility: Show content when expanded */
.accordion-trigger[aria-expanded="true"] + .accordion-content,
.accordion-item.active .accordion-content {
    max-height: 500px;
    padding-bottom: 1.5rem;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    background: #020617;
    padding: 5rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-main); }
.footer-text { color: var(--text-muted); margin-bottom: 1rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: 0.3s; display: inline-block;}
.footer-links a:hover { color: var(--primary); padding-left: 5px; }
.footer-email { color: var(--primary); text-decoration: none; font-weight: 600; }

.footer-bottom { border-top: 1px solid var(--border); padding-top: 2rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* Progress Modal */
.progress-modal {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.progress-card {
    width: 320px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    color: var(--text-main);
}

.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.progress-title-wrapper { display: flex; align-items: center; gap: 0.75rem; }
.progress-title { font-weight: 600; }
.progress-close { background: none; border: none; color: var(--text-muted); cursor: pointer; }
.progress-filename { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.progress-bar {
    background: rgba(255,255,255,0.1);
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    height: 100%;
    width: 0%;
    transition: width 0.2s;
}
.progress-percent { font-size: 0.8rem; text-align: right; color: var(--text-muted); margin-top: 5px; }

/* Toast */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 999;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 17px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

.toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

.toast.success { background-color: rgba(16, 185, 129, 0.9); backdrop-filter: blur(10px); }
.toast.error { background-color: rgba(239, 68, 68, 0.9); backdrop-filter: blur(10px); }

@keyframes fadein {
    from {bottom: 0; opacity: 0;}
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;}
    to {bottom: 0; opacity: 0;}
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    max-width: 400px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    z-index: 9999;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.cookie-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.cookie-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
}

.cookie-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .input-section { flex-direction: column; background: transparent; border: none; padding: 0; box-shadow: none; }
    .input-field { background: rgba(255,255,255,0.05); }
    .fetch-btn { width: 100%; }
    .hero-title { font-size: 2.5rem; }
    .seo-content-section { padding: 2rem; }
    
    .cookie-banner {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }
}