:root {
    --bg-main: #FFFFFF;
    --bg-card: #F9F9F9;
    --bg-input: #FFFFFF;
    --primary-red: #E60023;
    --primary-red-hover: #C9001D;
    --text-main: #000000;
    --text-muted: #666666;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.2);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s ease;
}

body.dark-mode {
    --bg-main: #121212;
    --bg-card: #1E1E1E;
    --bg-input: #2C2C2C;
    --primary-red: #E60023;
    --primary-red-hover: #C9001D;
    --text-main: #FFFFFF;
    --text-muted: #AAAAAA;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

main {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

/* Navbar */
.navbar {
    background-color: var(--bg-main);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.3rem;
}

.logo img {
    height: 44px;
    width: auto;
    object-fit: contain;
}

nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-main);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--text-main);
}

/* Common Section Styles */
section {
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.highlight {
    color: var(--primary-red);
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.gap-20 { gap: 30px; }

/* Hero Section */
.hero {
    text-align: center;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 50px;
}

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

.downloader-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.input-group {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--border-hover);
}

.input-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    padding: 20px 20px 20px 50px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

#download-btn {
    background-color: var(--primary-red);
    color: var(--text-main);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 32px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

#download-btn:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-2px);
}

/* Cards General */
.step-card, .info-card, .platform-card, .feature-card, .safety-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 40px 30px;
    transition: var(--transition);
}

.step-card:hover, .info-card:hover, .platform-card:hover, .feature-card:hover, .safety-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-5px);
}

/* How to Download */
.step-card { text-align: center; }
.icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(230, 0, 35, 0.1);
    color: var(--primary-red);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    margin: 0 auto 24px;
}
.step-card h3 { margin-bottom: 12px; font-size: 1.2rem; }
.step-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Info Grid */
.info-card h3 { margin-bottom: 24px; font-size: 1.3rem; }
.check-list { list-style: none; }
.check-list li {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.check-list li i { color: var(--primary-red); margin-top: 4px; }
.check-list li strong { color: var(--text-main); }

/* Platforms */
.platform-card { text-align: center; }
.platform-icon { font-size: 2.5rem; color: var(--primary-red); margin-bottom: 20px; }
.platform-card h3 { margin-bottom: 12px; }
.platform-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Why Use */
.feature-card { text-align: center; padding: 30px 20px; }
.icon-square {
    width: 50px;
    height: 50px;
    background-color: var(--primary-red);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    margin: 0 auto 20px;
}
.feature-card h3 { margin-bottom: 12px; font-size: 1.1rem; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Safety */
.safety-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 30px;
}
.safety-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(230, 0, 35, 0.1);
    color: var(--primary-red);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.safety-card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.safety-card p { color: var(--text-muted); font-size: 0.95rem; }

/* FAQ Accordion */
.accordion { max-width: 800px; margin: 0 auto; }
.accordion-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}
.accordion-header {
    width: 100%;
    padding: 24px;
    background: transparent;
    border: none;
    text-align: left;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}
.accordion-header:hover { background-color: rgba(255,255,255,0.02); }
.accordion-header i { transition: transform 0.3s; color: var(--text-muted); }
.accordion-header.active i { transform: rotate(180deg); }
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.accordion-content p {
    padding: 0 24px 24px;
    color: var(--text-muted);
}

/* Footer */
.main-footer {
    background-color: var(--bg-card);
    padding: 80px 0 30px;
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}
.footer-brand .logo { margin-bottom: 16px; font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.footer-brand p { color: var(--text-muted); max-width: 350px; font-size: 0.95rem; }
.footer-links-group h3 { margin-bottom: 20px; font-size: 1.1rem; }
.footer-links-group ul { list-style: none; }
.footer-links-group ul li { margin-bottom: 12px; }
.footer-links-group ul a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}
.footer-links-group ul a:hover { color: var(--primary-red); }
.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Results section overrides */
#result-section {
    margin-top: 30px;
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.preview-container {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.preview-left {
    flex: 1;
    display: flex;
    justify-content: center;
}

.preview-right {
    flex: 1;
    display: flex;
    justify-content: center;
}

.media-preview {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
}

.download-btn {
    background: #ff2c2c;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.download-btn:hover {
    background: #e60000;
}

@media (max-width: 768px) {
    .preview-container {
        flex-direction: column;
        align-items: center;
    }

    .preview-right {
        margin-top: 15px;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.5rem; }
    .downloader-box { flex-direction: column; background: transparent; border: none; box-shadow: none; padding: 0; }
    .input-group { background: var(--bg-card); border: 1px solid var(--border-color); }
    #download-btn { padding: 20px; justify-content: center; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .hero { padding: 60px 0 40px; }
    .hero h1 { font-size: 2rem; }
    .safety-card { flex-direction: column; text-align: center; align-items: center; }
}

.hidden { display: none !important; }
.error { color: #ff6b6b; margin-top: 20px; font-weight: 500; }
#loading { margin-top: 30px; color: var(--text-muted); }
.spinner {
    width: 30px; height: 30px; border: 3px solid var(--border-color);
    border-top-color: var(--primary-red); border-radius: 50%;
    animation: spin 1s infinite linear; margin: 0 auto 10px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

#top-error-message {
  text-align: center;
  margin-bottom: 15px;
  font-size: 14px;
}
