* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-1: #eef2f7;
    --bg-2: #e7edf6;
    --paper: #ffffff;
    --ink: #1b263b;
    --muted: #65748b;
    --line: rgba(27, 38, 59, 0.12);

    --accent: #3a86ff;
    --accent-2: #4ea8de;
    --accent-3: #5e60ce;

    --success: #18b979;
    --warning: #f5b700;
    --danger: #ef476f;

    --radius: 16px;
    --radius-lg: 24px;
    --shadow-soft: 0 10px 30px rgba(10, 18, 31, 0.12);
    --shadow-hard: 0 20px 55px rgba(10, 18, 31, 0.24);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", "Trebuchet MS", Tahoma, sans-serif;
    background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
}

#starCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.2;
}

.ambient-blobs {
    display: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(55px);
    opacity: 0.45;
    animation: drift 14s ease-in-out infinite;
}

.blob-1 {
    width: 240px;
    height: 240px;
    top: 6%;
    left: 4%;
    background: rgba(255, 111, 61, 0.5);
}

.blob-2 {
    width: 280px;
    height: 280px;
    right: 4%;
    top: 35%;
    background: rgba(0, 180, 216, 0.48);
    animation-delay: -5s;
}

.blob-3 {
    width: 220px;
    height: 220px;
    bottom: 3%;
    left: 33%;
    background: rgba(30, 144, 255, 0.4);
    animation-delay: -8s;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(14px, -18px) scale(1.08); }
}

.container {
    width: min(1160px, 92vw);
    margin: 16px auto 38px;
    position: relative;
    z-index: 1;
}

.navbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    direction: ltr;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 6px 18px rgba(27, 38, 59, 0.09);
    position: sticky;
    top: 14px;
    z-index: 30;
    backdrop-filter: blur(10px);
}

.navbar-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
}

.logo-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    color: white;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(255, 111, 61, 0.28);
}

.logo-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.logo-text {
    color: var(--ink);
    letter-spacing: 0.2px;
    font-size: 1.02rem;
}

.navbar-links {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.navbar-link {
    text-decoration: none;
    color: var(--muted);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 13px;
    border-radius: 999px;
    transition: 0.24s ease;
}

.navbar-link:hover {
    color: var(--ink);
    background: rgba(30, 144, 255, 0.12);
}

.navbar-link.active {
    color: white;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.language-switcher {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    width: 172px;
    min-width: 172px;
    max-width: 172px;
    direction: ltr;
    justify-self: end;
    flex-shrink: 0;
}

.language-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    width: 96px;
    min-width: 96px;
    max-width: 96px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-button {
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    font-weight: 800;
    font-size: 0.78rem;
    border-radius: 999px;
    width: 38px;
    min-width: 38px;
    text-align: center;
    padding: 6px 0;
    cursor: pointer;
    transition: 0.2s ease;
}

.lang-button:hover {
    transform: translateY(-1px);
}

.lang-button.active {
    color: white;
    border-color: transparent;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.lang-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: white;
    cursor: pointer;
    padding: 9px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    margin: 5px 0;
    border-radius: 1px;
    transition: 0.25s ease;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.hero {
    text-align: center;
    margin: 28px auto 20px;
    color: var(--ink);
}

.hero-badge {
    display: none;
}

.logo {
    font-size: clamp(1.8rem, 4.3vw, 3rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    background: none;
    -webkit-text-fill-color: currentColor;
}

.subtitle {
    margin: 10px auto 0;
    max-width: 740px;
    line-height: 1.6;
    color: var(--muted);
    font-size: 0.98rem;
}

.page-content {
    display: none;
    background: rgba(247, 248, 251, 0.98);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hard);
    padding: 28px;
}

.page-content.active {
    display: block;
    animation: reveal 0.34s ease;
}

#home {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

@keyframes reveal {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.stat-item {
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--line);
    text-align: center;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(27, 38, 59, 0.07);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--ink);
}

.stat-label {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.feature {
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: 0 4px 12px rgba(27, 38, 59, 0.07);
    padding: 14px;
    transition: 0.2s ease;
}

.feature:hover {
    transform: translateY(-2px);
}

.feature-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
    background: linear-gradient(130deg, var(--accent), var(--accent-3));
    margin-bottom: 10px;
}

.feature h3 {
    font-size: 0.96rem;
    margin-bottom: 6px;
    color: var(--ink);
}

.feature p {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--muted);
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 20px rgba(27, 38, 59, 0.08);
    padding: 20px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.35rem;
    margin-bottom: 20px;
}

.card-title i {
    color: var(--accent-3);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.88rem;
    color: var(--ink);
    font-weight: 700;
}

.input-with-toggle {
    position: relative;
}

.input-field {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--ink);
    background: white;
    padding: 12px 14px;
    transition: 0.2s ease;
}

.input-with-toggle .input-field {
    padding-right: 44px;
}

.input-field:focus {
    outline: none;
    border-color: rgba(30, 144, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.16);
}

.toggle-visibility {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: white;
    color: var(--muted);
    cursor: pointer;
}

.progress-container {
    margin-bottom: 14px;
}

.progress-bar-wrap {
    height: 9px;
    border-radius: 999px;
    overflow: hidden;
    background: #d9e4f3;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    transition: width 0.35s ease;
}

.progress-label {
    display: inline-block;
    margin-top: 7px;
    font-weight: 700;
    color: var(--muted);
    font-size: 0.82rem;
}

.btn {
    width: 100%;
    border: 0;
    border-radius: 13px;
    background: var(--accent);
    color: white;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    padding: 12px;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(58, 134, 255, 0.25);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-stop {
    margin-top: 9px;
    background: #d94870;
}

.log-container {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8fbff;
    color: var(--ink);
    max-height: 300px;
    overflow: auto;
    padding: 12px;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.log-header h4 {
    font-size: 0.9rem;
}

.log-actions {
    display: flex;
    gap: 8px;
}

.log-btn {
    border: 1px solid var(--line);
    background: white;
    color: var(--muted);
    border-radius: 8px;
    width: 29px;
    height: 29px;
    cursor: pointer;
}

.log-entry {
    display: flex;
    gap: 8px;
    align-items: start;
    border-bottom: 1px dashed rgba(18, 31, 56, 0.11);
    padding: 6px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-entry:last-child {
    border-bottom: 0;
}

.log-timestamp {
    color: #7b879b;
    font-size: 0.75rem;
    min-width: 55px;
}

.log-success { color: var(--success); }
.log-warning { color: var(--warning); }
.log-error { color: var(--danger); }
.log-info { color: var(--accent-3); }

.addon-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.addon-card p {
    line-height: 1.6;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 18px;
}

.addon-placeholder {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.addon-chip {
    border-radius: 999px;
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
    font-size: 0.78rem;
    padding: 7px 10px;
    font-weight: 700;
}

.page-content h2 {
    margin-bottom: 14px;
    font-size: 1.45rem;
}

.page-content p,
.page-content li {
    line-height: 1.72;
    color: #1d2b45;
}

.page-content ul {
    padding-inline-start: 22px;
    margin: 10px 0;
}

.faq-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    background: white;
}

.faq-question {
    padding: 13px 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 14px;
    color: var(--muted);
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 220px;
    padding: 0 14px 13px;
}

.faq-arrow {
    transition: transform 0.2s ease;
}

.faq-item.active .faq-arrow {
    transform: rotate(180deg);
}

.simple-link {
    color: var(--accent-3);
    font-weight: 700;
    text-decoration: none;
}

.simple-link:hover {
    text-decoration: underline;
}

.footer {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.social-links {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.social-link {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--ink);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    transition: 0.2s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    background: #ffffff;
}

.footer-text {
    margin-bottom: 9px;
}

.footer-support-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: var(--accent-3);
    text-decoration: none;
    font-weight: 800;
}

.footer-support-link:hover {
    text-decoration: underline;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(27, 38, 59, 0.35);
    backdrop-filter: blur(4px);
    z-index: 40;
    padding: 16px;
}

.modal-content {
    width: min(420px, 94vw);
    background: white;
    color: var(--ink);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-hard);
    padding: 24px;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 9px;
}

.modal-content p {
    margin-bottom: 15px;
    color: var(--muted);
    line-height: 1.6;
}

.toast-container {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: rgba(27, 38, 59, 0.94);
    color: white;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.84rem;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 210px;
    box-shadow: 0 10px 26px rgba(10, 18, 31, 0.28);
    border-left: 4px solid var(--accent-2);
    animation: toast-in 0.2s ease;
}

.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-success { border-left-color: var(--success); }

@keyframes toast-in {
    from { transform: translateX(12px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.scroll-top-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    color: white;
    background: var(--accent);
    box-shadow: 0 8px 20px rgba(58, 134, 255, 0.24);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: 0.22s ease;
}

.scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.corner-ad {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 320px;
    background:
        radial-gradient(circle at top right, rgba(78, 168, 222, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 255, 0.98) 100%);
    border: 1px solid rgba(58, 134, 255, 0.16);
    border-radius: 18px;
    box-shadow: 0 20px 42px rgba(10, 18, 31, 0.22);
    z-index: 60;
    overflow: hidden;
    animation: corner-ad-in 0.34s ease;
}

.corner-ad[hidden] {
    display: none !important;
}

.corner-ad.corner-ad-no-image {
    width: 304px;
}

.corner-ad-inner {
    display: flex;
    height: 100%;
}

.corner-ad-image {
    width: 96px;
    height: 100%;
    object-fit: cover;
    border-right: 1px solid var(--line);
    flex-shrink: 0;
}

.corner-ad-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
}

.corner-ad-badge {
    align-self: flex-start;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(58, 134, 255, 0.12);
    color: var(--accent);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.corner-ad-title {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.25;
    color: #1a1a2e;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.corner-ad-desc {
    margin: 0;
    color: #444;
    font-size: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.corner-ad-btn {
    align-self: flex-start;
    text-decoration: none;
    color: white;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.76rem;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(58, 134, 255, 0.22);
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.corner-ad-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(58, 134, 255, 0.32);
}

.corner-ad-close {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    color: var(--muted);
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    font-size: 0.95rem;
}

@keyframes corner-ad-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 980px) {
    .features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .navbar {
        grid-template-columns: auto auto 1fr;
        border-radius: 18px;
        padding: 11px;
    }

    .hamburger {
        display: inline-block;
    }

    .navbar-links {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        gap: 6px;
        background: rgba(247, 248, 251, 0.98);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: var(--shadow-soft);
        padding: 12px;
    }

    .navbar-links.open {
        display: flex;
    }

    .language-switcher {
        justify-self: end;
        width: 140px;
        min-width: 140px;
    }
}

@media (max-width: 620px) {
    .container {
        width: min(1140px, 94vw);
    }

    .page-content {
        padding: 18px;
    }

    .stats-bar {
        grid-template-columns: 1fr;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 18px;
    }

    .language-label {
        display: none;
    }

    .language-switcher {
        width: auto;
        min-width: 0;
    }

    .corner-ad {
        right: 10px;
        left: 10px;
        width: auto;
        height: auto;
        min-height: 124px;
    }

    .corner-ad-image {
        width: 86px;
    }

    .corner-ad.corner-ad-no-image {
        width: auto;
    }

    .corner-ad-close {
        width: 30px;
        height: 30px;
    }
}

html[dir="rtl"] .language-switcher {
    direction: ltr;
}
