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

html,
body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #F8FAFF;
    color: #1E293B;
    line-height: 1.6;
}

h1 {
    font-size: 48px;
    font-weight: 600;
    color: #4F46E5;
    margin-bottom: 20px;
}

h2 {
    font-size: 36px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 16px;
}

h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 12px;
}

p {
    font-size: 16px;
    font-weight: 400;
    color: #1E293B;
    line-height: 1.8;
}

ul {
    padding-left: 0;
}

/* List Styling */
ul {
    padding-left: 0;
    list-style-position: inside;
}

li {
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    h1 { font-size: 36px; }
    h2 { font-size: 28px; }
    h3 { font-size: 20px; }
}

/* Header */
header {
    background: #F8FAFF;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

@media (max-width: 768px) {
    header {
        position: relative;
    }
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #4F46E5;
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #4F46E5;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #4F46E5;
    margin: 5px 0;
    border-radius: 3px;
    transition: 0.3s;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-top: 1px solid #eee;
}

.mobile-nav.active {
    display: block;
}

.mobile-nav a {
    display: block;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    .social-links {
        display: none;
    }
}

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

/* Hero Section */
.hero {
    padding: 40px 0 80px;
    text-align: center;
}

.download-box {
    width: 80%;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 100px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.1);
}

.hero-description {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 18px;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .hero {
        padding: 0;
    }
    .download-box {
        width: auto;
        margin: 0 -20px;
        padding: 40px 20px;
        border-radius: 0;
    }
    .hero-description {
        font-size: 16px;
    }
}

.input-group {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
}

.input-group input {
    flex: 1;
    min-width: 0;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-right: none;
    border-radius: 12px 0 0 12px;
    font-size: 16px;
    outline: none;
    background: white;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: #4F46E5;
    z-index: 1;
}

.input-group button {
    padding: 14px 28px;
    background: #4F46E5;
    color: white;
    border: 2px solid #4F46E5;
    border-radius: 0 12px 12px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
    flex-shrink: 0;
    white-space: nowrap;
}

.input-group button:hover {
    background: #4338CA;
    border-color: #4338CA;
}

/* Download Result Styles */
#downloadResult {
    display: none;
    margin-top: 30px;
    text-align: left;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.video-info {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.video-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
    background: #eee;
}

.video-details {
    flex: 1;
}

.video-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1E293B;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.video-meta {
    font-size: 14px;
    color: #64748B;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #F8FAFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    transition: all 0.2s;
}

.download-option:hover {
    border-color: #4F46E5;
    background: #F1F5F9;
}

.format-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quality-badge {
    background: #4F46E5;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.format-details {
    font-size: 14px;
    color: #1E293B;
    font-weight: 500;
}

.size-info {
    font-size: 13px;
    color: #64748B;
}

.download-btn {
    background: #4F46E5;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.download-btn:hover {
    background: #4338CA;
}

/* New Result Layout Styles */
.result-header {
    margin-bottom: 24px;
}
.main-title {
    font-size: 20px;
    font-weight: 600;
    color: #1E293B;
    line-height: 1.4;
}
.result-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.result-card {
    display: flex;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    gap: 20px;
    align-items: stretch;
}
.card-thumbnail {
    flex-shrink: 0;
    width: 160px;
    height: 90px;
}
.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.card-thumbnail .no-thumb {
    width: 100%;
    height: 100%;
    background: #eee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}
.card-title {
    font-size: 14px;
    font-weight: 400;
    color: #64748B;
    margin-bottom: 12px;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.meta-info {
    font-size: 14px;
    color: #334155;
    font-weight: 500;
}
.download-btn-new {
    background: white;
    color: #4F46E5;
    border: 1px solid #4F46E5;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.download-btn-new:hover {
    background: #F8FAFF;
    border-color: #4338CA;
    color: #4338CA;
}

@media (max-width: 600px) {
    .result-card {
        flex-direction: column;
        gap: 12px;
    }
    .card-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
}

/* Error Toast */
.error-toast {
    display: none;
    background-color: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    margin: 30px auto;
    width: 40px;
    height: 40px;
    border: 3px solid #E2E8F0;
    border-top: 3px solid #4F46E5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.disclaimer {
    font-size: 12px;
    color: #808080;
    font-style: italic;
}

/* Sections */
section {
    padding: 60px 20px;
}

.content-section {
    max-width: 1000px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px;
}

/* Platform Grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: white;
    border-radius: 12px;
    text-decoration: none;
    color: #1E293B;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 140px;
}

.platform-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
}

.platform-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .platform-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .platform-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .platform-item {
        height: 120px;
    }
}

/* Description Section */
.description-section {
    padding: 80px 20px;
}

.description-content {
    max-width: 1000px;
    margin: 0 auto;
}

.description-intro {
    margin-bottom: 60px;
}

.feature-text-block {
    margin-bottom: 50px;
}

@media (max-width: 768px) {
    .description-section {
        padding: 60px 20px;
    }
}

/* How To Section */
.howto-section {
    padding: 80px 20px;
}

.howto-content {
    max-width: 1000px;
    margin: 0 auto;
}

.howto-intro {
    margin-bottom: 60px;
}

.step-text-block {
    margin-bottom: 50px;
}

@media (max-width: 768px) {
    .howto-section {
        padding: 60px 20px;
    }
}

/* Core Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-top: 30px;
}

.features-grid .feature-card {
    margin-top: 0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
}

.feature-icon {
    width: 50px;
    height: 50px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 24px;
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* FAQ Section */
.faq-section {
    padding: 80px 20px;
}

.faq-content {
    max-width: 1000px;
    margin: 0 auto;
}

.faq-intro {
    margin-bottom: 60px;
}

.faq-block {
    margin-bottom: 50px;
}

.faq-block h3 {
    font-size: 24px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .faq-section {
        padding: 60px 20px;
    }
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.tool-link {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #F8FAFF;
    border-radius: 8px;
    text-decoration: none;
    color: #1E293B;
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
    min-height: 80px;
    line-height: 1.4;
}

.tool-link:hover {
    background: transparent;
    color: #4F46E5;
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    background: #EDF2F7;
    padding: 0;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px 0;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 0.8fr;
    gap: 40px;
    margin-bottom: 40px;
    text-align: left;
}

.footer-about h3 {
    font-size: 20px;
    margin-bottom: 16px;
}

.footer-links h3 {
    font-size: 20px;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

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

.footer-links a:hover {
    color: #4F46E5;
}

.footer-bottom {
    padding: 30px 20px 20px;
    border-top: 1px solid #CBD5E0;
}

.footer-bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-disclaimer {
    font-size: 14px;
    color: #808080;
    margin-bottom: 20px;
}

.footer-copyright {
    font-size: 14px;
    color: #808080;
    text-align: center;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* Mobile Input Group Fix */
@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
        gap: 12px;
    }

    .input-group input {
        width: 100%;
        border-radius: 12px;
        border-right: 2px solid #e5e7eb;
    }

    .input-group button {
        width: 100%;
        border-radius: 12px;
    }
}