/* --- Local Fonts Definition --- */

/* Inter Variable Font */
@font-face {
    font-family: 'Inter';
    src: url('./fonts/inter-var.woff2') format('woff2-variations');
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
}


/* Base Classes for Icons */
.fas, .fa-solid {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.fab, .fa-brands {
    font-family: 'Font Awesome 6 Brands';
    font-weight: 400;
}

.fas, .fab, .far, .fa-solid, .fa-brands {
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* --- Variables --- */
:root {
    --primary-color: #ff0000;
    --primary-hover: #ad081b;
    --bg-color: #f8f9fa;
    --box-bg: #ffffff;
    --text-color: #333;
    --text-light: #666;
    --border-radius: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    direction: ltr;
}

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    gap: 25px;
    list-style: none;
    align-items: center;
}

.nav-links {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.nav-links:hover {
    color: var(--primary-color);
}

/* Install App Button (Hidden by default) */
.nav-install-btn {
    display: none; /* Shown via JS if installable */
    background-color: #222;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    border: none;
    margin-left: 10px;
}

.nav-install-btn:hover {
    background-color: #000;
}

/* Language Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1;
    border-radius: 8px;
    right: 0;
    top: 100%;
    padding: 10px 0;
}

.dropdown-content a {
    color: #333;
    padding: 8px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--primary-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Mobile Menu */
.nav-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #333;
    transition: all 0.3s ease;
}

/* Hero Section */
.main-container {
    width: 100%;
    max-width: 800px;
    margin: 80px auto 160px;
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    color: #333;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

/* Downloader Box */
.downloader-box {
    background: var(--box-bg);
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.input-group {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

input[type="url"] {
    width: 100%;
    padding: 18px 55px 18px 25px; 
    border: 2px solid #e1e1e1;
    border-radius: 50px;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="url"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.1);
}

#pasteBtn {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    font-size: 1.4rem;
    transition: color 0.3s;
}

#pasteBtn:hover {
    color: var(--primary-color);
}

.btn-download {
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 100%;
    padding: 18px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-download:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.loader {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid #fff;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Results */
.result-container {
    margin-top: 30px;
    text-align: left;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.badge {
    background: #f0f0f0;
    color: #333;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.result-media {
    width: 100%;
    max-height: 500px;
    border-radius: 12px;
    margin-bottom: 20px;
    object-fit: contain;
    background: #000;
    display: block;
}

.download-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.dl-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 40px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.dl-link:hover {
    background-color: #218838;
}

.result-caption-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
}

.result-caption-box h4 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #333;
}

.caption-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.copy-caption-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 8px;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.copy-caption-btn:hover {
    background: #fff;
    border-color: #aaa;
    color: #333;
}

.error-msg {
    color: #d32f2f;
    background: #ffebee;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

/* Content Wrapper */
.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    margin-bottom: 80px;
}

section h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 800;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* How to Use */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fff;
    padding: 40px;
    border-radius: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* SEO Article (Read More) */
.seo-article {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.02);
    position: relative;
}

.seo-article h2 {
    text-align: left;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.seo-article h3 {
    font-size: 1.3rem;
    margin: 25px 0 10px;
    color: #444;
    font-weight: 700;
}

.seo-article p {
    margin-bottom: 15px;
    color: #555;
    font-size: 1rem;
    line-height: 1.8;
}

.article-content {
    max-height: 350px; /* Initial visible height */
    overflow: hidden;
    position: relative;
    transition: max-height 0.5s ease;
}

.article-content.expanded {
    max-height: none;
}

/* Gradient Overlay */
.article-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
    transition: opacity 0.3s;
}

.article-content.expanded::after {
    opacity: 0;
}

.read-more-btn {
    display: block;
    margin: 20px auto 0;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.read-more-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* FAQ Section */
.faq-item {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.faq-item h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #333;
    font-weight: 700;
}

.faq-item p {
    color: #666;
    font-size: 0.95rem;
}

/* Footer */
.site-footer {
    background: #222;
    color: #eee;
    padding: 60px 20px 20px;
    margin-top: 50px;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #888;
}

.disclaimer {
    margin-bottom: 15px;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* Mobile Response */
@media screen and (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #fff;
        position: absolute;
        top: 70px;
        left: 0;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .downloader-box {
        padding: 25px 15px;
    }

    .input-group {
        flex-direction: column;
        gap: 10px;
    }

    input[type="url"] {
        padding: 15px;
    }

    #pasteBtn {
        top: 15px;
        right: 15px;
    }

    .btn-download {
        width: 100%;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        padding-left: 15px;
    }
}