/* RESET & FONTS */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    /* LIGHT MODE (Default) */
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #222222;
    --text-sec: #555555;
    --text-muted: #888888;
    --primary: #e60023;
    --primary-hover: #c5001f;
    --border-color: rgba(0, 0, 0, 0.05);
    --shadow-subtle: rgba(0, 0, 0, 0.03);
    --shadow-card: rgba(0, 0, 0, 0.08);
    --input-bg: #f8f9fa;
    --input-border: #edf2f7;
    --nav-link: #333;
    --header-bg: #ffffff;
    --footer-bg: #ffffff;
    --feature-icon-bg: #fff0f1;
    --faq-bg: #fafafa;
    --faq-border: #eee;
    --author-bg: linear-gradient(135deg, #ffffff 0%, #fff8f8 100%);
    --overlay-bg: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] {
    /* DARK MODE */
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #e1e1e1;
    --text-sec: #b0b0b0;
    --text-muted: #6e6e6e;
    --primary: #ff4757;
    /* Brighter red for dark mode */
    --primary-hover: #ff6b81;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-subtle: rgba(0, 0, 0, 0.2);
    --shadow-card: rgba(0, 0, 0, 0.3);
    --input-bg: #2d2d2d;
    --input-border: #444;
    --nav-link: #e1e1e1;
    --header-bg: #1e1e1e;
    --footer-bg: #1e1e1e;
    --feature-icon-bg: #2d1a1a;
    --faq-bg: #252525;
    --faq-border: #333;
    --author-bg: linear-gradient(135deg, #1e1e1e 0%, #252525 100%);
    --overlay-bg: rgba(18, 18, 18, 0.95);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background 0.3s ease, color 0.3s ease;
}

/* HEADER */
.site-header {
    width: 100%;
    background: var(--header-bg);
    box-shadow: 0 4px 12px var(--shadow-subtle);
    margin-bottom: 40px;
    padding: 15px 0;
    animation: fadeInUp 0.5s ease-out;
    transition: background 0.3s ease;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.header-nav {
    display: flex;
    gap: 15px;
    /* Reduced gap slightly */
    align-items: center;
}

.header-nav a {
    text-decoration: none;
    color: var(--nav-link);
    font-weight: 600;
    font-size: 15px;
    transition: color 0.2s;
}

.header-nav a:hover {
    color: var(--primary);
}

/* THEME TOGGLE BTN */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: var(--nav-link);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover {
    background: var(--border-color);
    color: var(--primary);
}

/* LOADING SPINNER */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--input-bg);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 15px;
    color: var(--text-main);
    font-weight: 600;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* CARD */
.card {
    background: var(--card-bg);
    width: 90%;
    max-width: 750px;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 15px 35px var(--shadow-card);
    text-align: center;
    margin: 0 20px 40px 20px;
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
    transition: background 0.3s ease;
}

.logo {
    color: var(--primary);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.subtitle {
    color: var(--text-sec);
    font-size: 15px;
    margin-bottom: 35px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

input[type="text"] {
    width: 100%;
    padding: 18px 110px 18px 25px;
    border: 2px solid var(--input-border);
    border-radius: 14px;
    font-size: 16px;
    background: var(--input-bg);
    color: var(--text-main);
    transition: border-color 0.3s, background 0.3s;
}

input[type="text"]:focus {
    border-color: var(--primary);
    background: var(--card-bg);
}

.action-icons {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
}

.btn-paste {
    background: #e7f1ff;
    /* Keep blue for contrast in light mode, maybe adjust for dark? */
    color: #007bff;
    border: none;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
}

[data-theme="dark"] .btn-paste {
    background: #1a2a3a;
    color: #4da3ff;
}

.btn-clear {
    background: #ffe6e6;
    color: #dc3545;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .btn-clear {
    background: #3a1a1a;
    color: #ff6b6b;
}

input[type="submit"] {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 8px 20px rgba(230, 0, 35, 0.25);
}

[data-theme="dark"] input[type="submit"] {
    box-shadow: 0 8px 20px rgba(255, 71, 87, 0.25);
}

input[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.result-box {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px dashed var(--border-color);
}

.media-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MEDIA WRAPPER */
.media-wrapper {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto 25px auto;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

video,
img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.d-btn {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 12px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
}

.fast-btn {
    background: #f0f7ff;
    color: #007bff;
    border: 1px solid #cce5ff;
}

[data-theme="dark"] .fast-btn {
    background: #1a2633;
    color: #4da3ff;
    border-color: #2a3b4d;
}

.normal-btn {
    background: #28a745;
    color: white;
}

.error {
    color: #d32f2f;
    background: #ffebee;
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #ffcdd2;
}

[data-theme="dark"] .error {
    background: #3e1b1b;
    color: #ff9999;
    border-color: #5c2b2b;
}

/* STEPS */
.steps-container {
    width: 90%;
    max-width: 850px;
    margin-bottom: 50px;
    animation: fadeInUp 0.7s ease-out 0.2s backwards;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 30px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.step-box {
    background: var(--card-bg);
    padding: 30px 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 5px 15px var(--shadow-subtle);
    transition: 0.3s;
}

.step-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px var(--shadow-card);
}

.step-icon {
    width: 60px;
    height: 60px;
    background: var(--feature-icon-bg);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px auto;
}

.step-icon svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.step-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.step-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* PREMIUM SEO CONTENT SECTION */
.seo-content {
    width: 90%;
    max-width: 850px;
    margin: 0 auto 40px auto;
}

.seo-card {
    background: var(--card-bg);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 5px 20px var(--shadow-subtle);
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, background 0.3s ease;
}

.seo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-card);
}

.seo-section {
    margin-bottom: 60px;
}

.seo-section:last-child {
    margin-bottom: 0;
}

.seo-title {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 800;
    position: relative;
    display: inline-block;
}

.seo-text {
    font-size: 16px;
    color: var(--text-sec);
    line-height: 1.8;
    margin-bottom: 15px;
}

.seo-text strong {
    color: var(--text-main);
}

/* PREMIUM FEATURES GRID */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-box {
    text-align: center;
    padding: 30px 20px;
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px var(--shadow-subtle);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.feature-box:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(230, 0, 35, 0.15);
    border-color: rgba(230, 0, 35, 0.1);
}

[data-theme="dark"] .feature-box:hover {
    box-shadow: 0 20px 40px rgba(255, 71, 87, 0.15);
    border-color: rgba(255, 71, 87, 0.2);
}

.feature-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #e60023, #ff4757);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.feature-box:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 42px;
    margin-bottom: 20px;
    display: inline-block;
    transition: transform 0.4s ease;
}

.feature-box:hover .feature-icon {
    transform: scale(1.2) rotate(5deg);
}

.feature-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    font-size: 18px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* PREMIUM FAQ (ACCORDION) */
.faq-item {
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px var(--shadow-subtle);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 8px 25px var(--shadow-card);
    transform: translateX(5px);
}

.faq-question {
    padding: 20px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s;
}

.faq-question:hover {
    color: var(--primary);
}

.faq-question::after {
    content: '+';
    font-size: 24px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    color: var(--text-sec);
    font-size: 15px;
    line-height: 1.7;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: var(--faq-bg);
}

.faq-item.active .faq-answer {
    padding-bottom: 20px;
    border-top: 1px solid var(--faq-border);
}

/* PREMIUM AUTHOR BOX */
.author-box {
    width: 90%;
    max-width: 850px;
    background: var(--author-bg);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 15px 40px var(--shadow-subtle);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease;
    animation: fadeInUp 0.9s ease-out 0.4s backwards;
}

.author-box:hover {
    transform: translateY(-5px);
}

.author-box::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(230, 0, 35, 0.03);
    border-radius: 50%;
    z-index: 0;
}

[data-theme="dark"] .author-box::after {
    background: rgba(255, 71, 87, 0.05);
}

.author-img {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(45deg, #e60023, #ff4757);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    border: 5px solid var(--card-bg);
    box-shadow: 0 10px 20px rgba(230, 0, 35, 0.2);
    position: relative;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.author-box:hover .author-img {
    transform: rotate(10deg) scale(1.1);
}

.author-info {
    position: relative;
    z-index: 1;
}

.author-info h3 {
    margin: 0;
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 5px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.author-info .role {
    color: var(--primary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 15px;
    display: inline-block;
    padding: 4px 10px;
    background: rgba(230, 0, 35, 0.05);
    border-radius: 20px;
}

[data-theme="dark"] .author-info .role {
    background: rgba(255, 71, 87, 0.1);
}

.author-bio {
    font-size: 15px;
    color: var(--text-sec);
    line-height: 1.8;
    margin: 0;
}

/* FOOTER */
.site-footer {
    width: 100%;
    background: var(--footer-bg);
    margin-top: auto;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-container p,
.footer-links a {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: none;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a:hover {
    color: var(--primary);
}

/* GLOBAL ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .card {
        padding: 30px 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .faq-answer {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* MOBILE INSTALL POPUP */
.mobile-install-popup {
    position: fixed;
    bottom: -100px;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    /* Use card-bg for consistency */
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 10000;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 20px;
    color: var(--text-main);
}

.mobile-install-popup.show {
    bottom: 0;
}

.popup-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 600px;
    margin: 0 auto;
}

.app-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-info img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
}

.text-info {
    display: flex;
    flex-direction: column;
}

.text-info strong {
    font-size: 16px;
    color: var(--text-main);
}

.text-info span {
    font-size: 13px;
    color: var(--text-muted);
}

#mobileInstallBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(230, 0, 35, 0.3);
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}