/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff0000;
    --secondary-color: #282828;
    --accent-color: #065fd4;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --white: #ffffff;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
}

/* Tool Container */
.tool-container {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto 2rem;
    position: relative;
}

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

#videoUrl {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    outline: none;
    transition: border-color 0.3s;
}

#videoUrl:focus {
    border-color: var(--primary-color);
}

.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #cc0000);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-download {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: var(--white);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #404040;
    transform: translateY(-2px);
}

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

/* Error Message */
.error-message {
    color: #d32f2f;
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: 500;
    min-height: 24px;
}

.error-message:not(:empty) {
    background-color: #ffebee;
    border-left: 4px solid #d32f2f;
}

/* Results Section */
.results-section {
    padding: 3rem 0;
    margin: 2rem auto;
}

.results-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 2rem;
}

.video-id-display {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.video-id-display span {
    font-weight: 600;
    color: var(--accent-color);
}

/* Thumbnails Gallery */
.thumbnails-gallery {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: none;
    margin: 0 auto;
    padding: 0 2rem;
    align-items: center;
}

.thumbnail-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: visible;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
    width: auto;
    display: inline-block;
}

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

.thumbnail-card-header {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ddd;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.thumbnail-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.thumbnail-card-header h3 small {
    font-size: 0.75rem;
    font-weight: 400;
    color: #666;
    font-family: monospace;
}

.resolution-badge {
    background: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.thumbnail-image-wrapper {
    position: relative;
    background: #000;
    display: block;
    overflow: visible;
    width: fit-content;
}

.thumbnail-image {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 2rem 1rem 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.thumbnail-card:hover .image-overlay {
    opacity: 1;
}

.quality-label {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.thumbnail-actions {
    padding: 1.25rem;
    display: flex;
    gap: 0.75rem;
    background: #fafafa;
}

.btn-download-card {
    flex: 1;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: var(--white);
}

.btn-download-card:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.btn-download-card svg {
    stroke-width: 2.5;
}

/* Old styles - keep for backward compatibility but hidden */
.thumbnail-preview,
.quality-selector,
.action-buttons,
.thumbnail-info {
    display: none;
}

/* Ad Spaces */
.ad-space {
    margin: 2rem auto;
    min-height: 90px;
}

.ad-horizontal {
    max-width: 728px;
}

.ad-space p {
    display: none; /* Hide placeholder text */
}

/* Ad Blocker Notice */
.adblocker-notice {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
    display: none; /* Hidden by default, shown by JS if ad blocker detected */
}

.adblocker-notice h3 {
    color: #856404;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.adblocker-notice p {
    color: #856404;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.adblocker-notice small {
    color: #856404;
    font-size: 0.85rem;
    opacity: 0.8;
}

/* How It Works Section */
.how-it-works {
    padding: 4rem 0;
    background: var(--white);
}

.how-it-works h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.step p {
    color: #666;
}

/* Features Section */
.features {
    padding: 4rem 0;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.feature p {
    color: #666;
}

/* FAQ Section */
.faq {
    padding: 4rem 0;
    background: var(--white);
}

.faq h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--secondary-color);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: #f9f9f9;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.faq-item h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.faq-item p {
    color: #666;
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 1rem;
    text-align: center;
    color: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

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

    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .thumbnails-gallery {
        padding: 0 1rem;
        gap: 2rem;
    }

    .thumbnail-card-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

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

    .thumbnail-image-wrapper {
        max-width: 100%;
        overflow: auto;
    }

    .thumbnail-image {
        max-width: 100%;
    }

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

    .btn-download-card {
        width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: fadeIn 0.5s ease-out;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease-out;
}

.share-modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.share-modal-content h3 {
    margin: 0 0 1.5rem 0;
    color: var(--secondary-color);
    text-align: center;
    font-size: 1.5rem;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--white);
}

.share-btn.twitter {
    background: #1DA1F2;
}

.share-btn.twitter:hover {
    background: #0d8bd9;
    transform: translateY(-2px);
}

.share-btn.facebook {
    background: #1877F2;
}

.share-btn.facebook:hover {
    background: #0c63d4;
    transform: translateY(-2px);
}

.share-btn.linkedin {
    background: #0A66C2;
}

.share-btn.linkedin:hover {
    background: #004182;
    transform: translateY(-2px);
}

.share-btn.whatsapp {
    background: #25D366;
}

.share-btn.whatsapp:hover {
    background: #1da851;
    transform: translateY(-2px);
}

.share-btn.reddit {
    background: #FF4500;
}

.share-btn.reddit:hover {
    background: #cc3700;
    transform: translateY(-2px);
}

.share-btn.copy-link {
    background: var(--secondary-color);
}

.share-btn.copy-link:hover {
    background: #404040;
    transform: translateY(-2px);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-modal:hover {
    background: #f0f0f0;
    color: var(--secondary-color);
}

/* Copy Success Notification */
.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    z-index: 2000;
}

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

