:root {
    --primary-color: #e74c3c; /* A classic Y2mate red-orange */
    --secondary-color: #2c3e50; /* Darker blue-grey for contrast */
    --text-color: #333;
    --text-light: #6c757d;
    --background-color: #f8f9fa;
    --white-color: #ffffff;
    --border-color: #e9ecef;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --header-height: 70px; /* Define header height for sticky calculations */
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden; /* Prevent horizontal scroll on mobile menu */
}

body.no-scroll {
    overflow: hidden; /* Prevent scrolling when mobile menu is open */
}

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

/* Header */
.site-header {
    background: var(--white-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Ensure it spans the full container width */
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color); /* Y2mate-nu.site brand color */
    text-decoration: none;
}

/* Desktop Navigation */
.nav-wrapper {
    display: flex; /* Flex for desktop menu and lang selector */
    align-items: center;
    gap: 2rem;
}

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

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

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

.lang-selector select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white-color);
    font-size: 0.9rem;
}

/* Menu Toggle Button (Hamburger) */
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-color);
    cursor: pointer;
    z-index: 1100; /* Above overlay */
}

/* Menu Overlay */
.menu-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
}
.menu-overlay.active {
    display: block;
}

/* Breadcrumbs - Hidden on Homepage */
.breadcrumbs {
    display: none; 
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); /* Stronger brand gradient */
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.hero .call-to-action {
    display: inline-block;
    background-color: var(--white-color);
    color: var(--primary-color);
    padding: 1rem 2.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.hero .call-to-action:hover {
    background-color: var(--secondary-color);
    color: var(--white-color);
}


/* Standard Section Styling (Full Width) */
main section {
    padding: 4rem 0; /* Consistent vertical spacing for all main sections */
    margin-bottom: 2.5rem; /* Space between sections */
    background-color: var(--white-color); /* Default background */
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    overflow: hidden; /* For lazy-load transitions */
}
main section:first-of-type { /* No extra margin above the first section (downloader) */
    margin-top: 2.5rem; 
}
main section:last-of-type { /* No extra margin below the last section */
    margin-bottom: 0;
}
main section:nth-of-type(odd) { /* Alternate background for readability */
    background-color: var(--background-color);
}
main section .container { /* Inner padding for content within sections */
    padding: 0 20px;
}

/* Featured Downloader Section (Main Tool UI) */
.featured-downloader-section { /* Renamed from .featured-tool-section */
    background: var(--white-color); 
    padding-top: 3rem; 
    padding-bottom: 3rem;
    text-align: center; 
}
.downloader-ui { /* Renamed from .featured-tool-ui */
    max-width: 800px; 
    margin: 0 auto; 
    background: var(--white-color); 
    border-radius: var(--border-radius);
    box-shadow: none;
    padding: 0; 
}

.downloader-ui .input-group {
    display: flex;
    margin-bottom: 1rem;
    border: 2px solid var(--primary-color); /* Highlight input */
    border-radius: var(--border-radius);
    overflow: hidden;
    max-width: 700px; /* Constrain input group width */
    margin-left: auto;
    margin-right: auto;
}

.downloader-ui .input-group input {
    flex: 1;
    padding: 1rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.downloader-ui .input-group input::placeholder {
    color: var(--text-light);
}

.downloader-ui .convert-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.downloader-ui .convert-btn:hover {
    background: var(--secondary-color); 
}

.downloader-ui .convert-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.downloader-ui .format-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    max-width: 700px; /* Constrain options width */
    margin-left: auto;
    margin-right: auto;
}

.downloader-ui .format-option {
    background: var(--background-color);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.downloader-ui .format-option.selected {
    border-color: var(--primary-color);
    background: rgba(231, 76, 60, 0.1);
}

.downloader-ui .format-option:hover {
    border-color: var(--primary-color);
}

.downloader-ui .format-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Banner Ad (780x90) */
.banner-ad-780x90 {
    width: 100%;
    max-width: 780px; /* Limit max width for ad */
    height: 90px;
    background-color: #e0e0e0; /* Placeholder for ad */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1rem;
    text-align: center;
    margin: 2.5rem auto; /* Center and add margin */
    border-radius: var(--border-radius);
    border: 1px dashed var(--border-color);
    overflow: hidden;
}

/* Headings common style */
main h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--secondary-color);
}

/* Benefits Grid (Renamed from Features) */
.benefits-grid { /* Renamed from .features-grid */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.benefit-card { /* Renamed from .feature-card */
    background: var(--white-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: transform 0.3s ease;
}
.benefit-card:hover {
    transform: translateY(-5px);
}
.benefit-icon { /* Renamed from .feature-icon */
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
.benefit-card h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}
.benefit-card p {
    color: var(--text-light);
}

/* How It Works (YouTube Download Steps) */
.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: var(--primary-color);
    color: 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: 1rem;
}

/* Explore More Converters - Lazy Loaded */
.more-converters.lazy-load-section, /* Renamed from .popular-tools */
.testimonials.lazy-load-section {
    opacity: 0; /* Initially hidden */
    transform: translateY(20px); /* Initially slightly off-screen */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform; /* Optimize for smooth animation */
}
.more-converters.lazy-loaded,
.testimonials.lazy-loaded {
    opacity: 1;
    transform: translateY(0);
}
.converter-grid { /* Renamed from .tool-grid */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.converter-card { /* Renamed from .tool-card */
    background: var(--white-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center; 
    text-decoration: none; 
    color: var(--text-color); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.converter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}
.converter-icon { /* Renamed from .tool-icon */
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}
.converter-card h3 {
    margin-bottom: 0.5rem; 
}
.converter-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* FAQ */
.faq-item {
    background: var(--background-color);
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    max-width: 800px; /* Constrain FAQ width */
    margin-left: auto;
    margin-right: auto;
}
.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    background: var(--white-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    transition: transform 0.3s ease, content 0.3s ease;
    margin-left: 1rem;
    color: var(--primary-color);
}
.faq-question.active::after {
    content: '-';
    transform: rotate(0deg);
}
.faq-question:hover {
    background: var(--background-color);
}
.faq-answer {
    padding: 1.5rem;
    color: var(--text-light);
    display: none;
}
.faq-answer.show {
    display: block;
}

/* Testimonials */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.testimonial {
    background: var(--white-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}
.stars {
    color: #ffc107;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.testimonial-author {
    display: flex;
    align-items: center;
    margin-top: 1rem;
}
.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

/* Footer */
.site-footer {
    background: var(--secondary-color);
    color: white;
    padding: 3rem 0 1rem;
}
.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 0 20px; /* Footer padding */
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}
.footer-section ul {
    list-style: none;
}
.footer-section li {
    margin-bottom: 0.5rem;
}
.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-section a:hover {
    color: white;
}
.social-links {
    margin-top: 1rem;
}
.social-links a {
    color: white;
    margin-right: 1rem;
    font-size: 1.2rem;
    transition: opacity 0.3s ease;
}
.social-links a:hover {
    opacity: 0.8;
}
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #495057;
    color: #ccc;
}

/* Progress indicator */
.progress-container {
    margin-top: 1rem;
    display: none;
}
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}
.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    display: none;
}
.status-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}
.status-error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
}
.status-info {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid #17a2b8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .banner-ad-780x90 {
        max-width: 728px; /* Common tablet banner size */
        margin: 2rem auto;
    }
    main section {
        padding: 3rem 0;
    }
    main section .container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    .header-container {
        padding: 0.8rem 0;
    }
    
    /* Mobile Nav Specifics */
    .menu-toggle {
        display: block; /* Show hamburger */
    }

    .nav-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%; /* Full width for overlay/menu */
        max-width: 300px; /* Max width for actual menu content */
        height: 100%;
        background: var(--white-color);
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        flex-direction: column;
        justify-content: flex-start; /* Align content to top */
        padding: var(--header-height) 20px 20px; /* Padding, considering header height */
        transform: translateX(100%); /* Start off-screen */
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        align-items: flex-start; /* Align text left */
    }

    .nav-wrapper.active {
        transform: translateX(0); /* Slide in */
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0; /* Remove gap */
        margin-bottom: 2rem; /* Space before lang selector */
        border-bottom: 1px solid var(--border-color); /* Separator */
        padding-bottom: 1rem;
    }

    .main-nav ul li {
        width: 100%;
        border-top: 1px solid var(--border-color);
    }
    .main-nav ul li:first-child {
         border-top: none; /* No top border for first item */
    }

    .main-nav a {
        padding: 1rem 0;
        display: block;
        width: 100%;
        font-size: 1.1rem;
    }

    .lang-selector {
        width: 100%;
        margin-top: 1rem;
    }
    .lang-selector select {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
        font-size: 1rem;
    }

    /* General mobile adjustments */
    .downloader-ui .input-group {
        flex-direction: column;
        max-width: 100%;
    }
    .downloader-ui .convert-btn {
        border-radius: 0 0 var(--border-radius) var(--border-radius);
    }
    .downloader-ui .format-options {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
    }
    .container {
        padding: 0 15px; /* Adjust container padding for mobile */
    }
    main h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    .benefits-grid, .steps-grid, .converter-grid, .testimonial-grid {
        grid-template-columns: 1fr; /* Single column for grids on small mobile */
    }
    .benefit-card, .step, .converter-card, .testimonial {
        padding: 1.5rem;
    }
    .faq-item {
        max-width: 100%;
        margin: 0 0 1rem 0; /* Remove auto margin */
    }
    .faq-question, .faq-answer {
        padding: 1.2rem;
    }
    .banner-ad-780x90 {
        height: 90px;
        max-width: 100%;
    }
    main section {
        padding: 2rem 0;
        margin-bottom: 1.5rem;
    }
    .featured-downloader-section {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    .featured-downloader-section {
        padding: 1.5rem 0;
    }
    .downloader-ui {
        padding: 0; /* Remove extra padding inside converter-section */
    }
    .downloader-ui .format-options {
        grid-template-columns: 1fr;
    }
    .header-container {
        padding: 0.8rem 0;
    }
    .logo {
        font-size: 1.5rem;
    }
    .hero h1 {
        font-size: 1.8rem;
    }
    .hero .subtitle {
        font-size: 1rem;
    }
    .banner-ad-780x90 {
        height: 60px; /* Smaller banners on tiny screens */
    }
}