:root {
    --bg-color: #0a0a0a;
    --card-bg: #111111;
    --card-border: #1f1f1f;
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --accent-color: #c44b35;
    --accent-hover: #b8422a;
    --font-main: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* --- NEW NAVBAR --- */
.navbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem; /* Use fixed rems instead of % */
    width: 100%;
    box-sizing: border-box;
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0; /* CRUCIAL: Allows children to shrink below their content size */
    flex: 1 1 0%; /* Aggressive flex shrink */
    margin-right: 1rem;
    overflow: hidden; /* Force bounds */
}

.nav-right {
    flex-shrink: 0; /* Button MUST NEVER shrink */
}

.logo {
    font-size: 1.1rem;
    font-weight: 900;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}
.logo span {
    color: var(--accent-color);
}

.logo-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

html, body {
    overflow-x: hidden;
}

.explore-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border-radius: 25px;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    border: none;
    transition: all 0.3s ease;
    gap: 0.4rem;
}
.explore-btn:hover {
    background-color: #d13e27;
    transform: translateY(-2px);
}
.explore-text {
    display: block;
    white-space: nowrap;
}

/* Desktop Header */
@media (min-width: 600px) {
    .navbar {
        padding: 1.2rem 2rem;
    }
    .nav-left {
        flex-direction: row;
        align-items: baseline;
        gap: 8px;
    }
    .logo {
        font-size: 1.6rem;
    }
    .logo-subtitle {
        font-size: 1.3rem;
        color: white;
        font-weight: 700;
    }
    .explore-btn {
        padding: 0.7rem 1.4rem;
        font-size: 1rem;
        gap: 0.6rem;
    }
}
/* --- END NEW NAVBAR --- */

/* Live Visitors Badge */
.live-visitors {
    display: none; /* Hidden on mobile by default */
}

@media (min-width: 600px) {
    .live-visitors {
        display: flex;
        align-items: center;
        gap: 8px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 6px 12px;
        border-radius: 50px;
        font-size: 0.85rem;
        color: #e0e0e0;
        margin-right: 15px;
    }
    
    .live-indicator {
        width: 8px;
        height: 8px;
        background-color: #4ade80; /* Green dot */
        border-radius: 50%;
        box-shadow: 0 0 8px #4ade80;
        animation: pulse-green 2s infinite;
    }
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.nav-links {
    display: none;
    gap: 2rem;
}
@media (min-width: 900px) {
    .nav-links {
        display: flex;
    }
}
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}
.nav-links a:hover {
    color: var(--text-primary);
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}
.lang-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    cursor: pointer;
}
.lang-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}
.lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    min-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
}
.lang-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}
.lang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.lang-grid a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: background 0.2s, color 0.2s;
}
.lang-grid a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
}
.lang-grid a span {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #888;
    background: rgba(255,255,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 30px;
    text-align: center;
}

/* Buttons */
.btn-primary-small, .btn-primary, .btn-secondary {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary-small {
    background-color: var(--accent-color);
    color: #fff;
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
}
.btn-primary-small:hover {
    background-color: var(--accent-hover);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    padding: 1rem 2rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
}
.btn-primary:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    padding: 1rem 2rem;
    font-size: 1rem;
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Main Layout */
.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 4rem 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow-x: hidden; /* Prevent child elements like glow-orb from expanding body width! */
}

/* Glowing Orb */
.glow-orb {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    max-width: 600px;
    height: 100vw;
    max-height: 600px;
    background: radial-gradient(circle, rgba(196,75,53,0.15) 0%, rgba(196,75,53,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Hero Section */
.hero-section {
    margin-bottom: 3rem;
    width: 100%;
}
.title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
@media (min-width: 768px) {
    .title {
        font-size: 4.5rem;
    }
}
.subtitle-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* SnapTik Form Layout */
.snaptik-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .snaptik-form {
        flex-direction: row;
        align-items: stretch;
    }
}

.input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
}
.input-wrapper input {
    width: 100%;
    padding: 1.2rem 6rem 1.2rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s;
}
.input-wrapper input:focus {
    border-color: var(--accent-color);
}
.btn-paste {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-paste:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-download {
    padding: 0 2.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    height: auto;
    min-height: 3.5rem;
}

/* Loading & States */
.hidden {
    display: none !important;
}

#loading {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-msg {
    margin-top: 2rem;
    padding: 1rem;
    background-color: rgba(196, 75, 53, 0.1);
    border-left: 3px solid var(--accent-color);
    color: #ffb4a5;
    text-align: left;
    border-radius: 4px;
}

/* Result Box */
.downloader-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .downloader-card {
        padding: 2.5rem;
    }
}

.result-box {
    margin-top: 2rem;
    text-align: left;
    animation: fadeIn 0.5s ease;
}
@media (min-width: 768px) {
    .result-box {
        margin-top: 3rem;
    }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
@media (min-width: 768px) {
    .result-content {
        flex-direction: row;
        align-items: flex-start;
    }
}

.video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    background-color: rgba(255,255,255,0.02);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
}
@media (min-width: 480px) {
    .video-info {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        padding: 1rem;
    }
}
.video-info img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}
.video-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.video-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-details p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.stats {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    justify-content: center;
}
@media (min-width: 480px) {
    .stats {
        justify-content: flex-start;
    }
}

.download-buttons {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Info Section & FAQ */
.card-layout {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 2.5rem;
    margin: 1rem auto 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.info-section {
    max-width: 800px;
    margin: 2rem auto;
    color: var(--text-secondary);
    text-align: start;
}
.info-section h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}
.info-section h3 {
    color: var(--text-primary);
    margin: 1.5rem 0 1rem;
}
.info-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
}
.info-section ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}
.info-section li {
    margin-bottom: 0.8rem;
    line-height: 1.6;
}

/* FAQ Accordion */
.faq-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.faq-item {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
}
.faq-header {
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.02);
    transition: background 0.3s;
}
.faq-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.faq-icon {
    transition: transform 0.3s ease;
}
.faq-item.active .faq-icon {
    transform: rotate(180deg);
}
.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    padding: 0 1.5rem;
}
.faq-item.active .faq-content {
    max-height: 500px;
    padding: 1.2rem 1.5rem;
    border-top: 1px solid var(--card-border);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}
.footer-links a:hover {
    color: var(--accent-color);
}
.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
