:root {
    --bg-light: #ffffff;
    --text-primary: #1F2328;
    --text-secondary: #656D76;
    --border-color: #D0D7DE;
    --btn-bg: #24292F;
    --btn-hover: #000000;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-nav {
    background: #ffffff;
    padding: 1.5rem 0;
    border-bottom: 1px solid #eaecef;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.main-menu {
    display: flex;
    gap: 2rem;
}

.main-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.2s;
}

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

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem;
    flex: 1;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 3rem auto;
}

.downloader-wrapper {
    max-width: 700px;
    margin: 0 auto;
}

.input-pill {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: #ffffff;
    padding: 0.35rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-pill:focus-within {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
}

input[type="url"] {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    outline: none;
}

input[type="url"]::placeholder {
    color: #8c959f;
}

.btn-primary {
    background: var(--btn-bg);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 140px;
}

.btn-primary:hover {
    background: var(--btn-hover);
}

.options-group {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    accent-color: var(--btn-bg);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.radio-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.btn-text.loading-hide {
    opacity: 0;
}

.trust-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-weight: 500;
}

/* Result Container */
.result-container {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-result-card {
    background: linear-gradient(135deg, #442a8a, #7645cf);
    border-radius: 12px;
    overflow: hidden;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.card-content {
    display: flex;
    flex-direction: row;
    padding: 1.5rem;
    gap: 2rem;
    align-items: center;
}

.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.2);
}

.user-nickname {
    font-size: 1.35rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

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

.btn-dl {
    display: block;
    text-align: center;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-dl-primary {
    background: #5bc0eb;
    color: #111;
}

.btn-dl-primary:hover {
    background: #4cb2de;
}

.btn-dl-secondary {
    background: #4aa7d4;
    color: #111;
}

.btn-dl-secondary:hover {
    background: #3e9bc8;
}

.video-stats {
    display: flex;
    justify-content: space-around;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.stat-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.error-message {
    color: #cf222e;
    background: #ffebe9;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    border: 1px solid #ff8182;
}

/* Features Section */
.features {
    margin-bottom: 4rem;
    text-align: center;
}

.features-header h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

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

.feature-item {
    padding: 1rem;
    text-align: left;
}

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

.feature-item h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* SEO Content */
.seo-content {
    background: #ffffff;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.seo-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.steps-list {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.steps-list li {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.seo-content p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* FAQ Section */
.faq-section {
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--border-color);
}

.faq-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.faq-item {
    background: #f6f8fa;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
}

.faq-item h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.faq-item p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Ad Slots */
.ad-slot {
    width: 100%;
    min-height: 0;        /* empty = invisible until AdSense fills it */
    overflow: hidden;
    text-align: center;
}

.ad-slot-top  { margin-bottom: 1.25rem; }
.ad-slot-bottom { margin-top: 1.25rem; }

/* User handle under nickname */
.user-handle {
    font-size: 0.85rem;
    opacity: 0.75;
    font-weight: 400;
}

footer {
    background: #f6f8fa;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 2.25rem; }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .input-pill {
        flex-direction: column;
        border-radius: 12px;
        border: none;
        background: transparent;
        padding: 0;
        gap: 0.5rem;
    }
    
    input[type="url"] {
        border: 1px solid var(--border-color);
        border-radius: 50px;
        width: 100%;
        background: #fff;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .user-result-card .card-content {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-dl {
        align-self: stretch;
    }
}
