* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-1: #000000;
    --bg-2: #0a0a0a;
    --paper: rgba(255, 255, 255, 0.045);
    --paper-2: rgba(255, 255, 255, 0.08);
    --ink: #f4f4f5;
    --muted: #9a9a9e;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.24);

    --accent: #ffffff;
    --accent-2: #c9c9c9;
    --accent-3: #8a8a8a;
    --grad: linear-gradient(120deg, #ffffff, #c0c0c0 55%, #8f8f8f);

    --success: #e5e5e5;
    --warning: #b5b5b5;
    --danger: #f5f5f5;

    --radius: 16px;
    --radius-lg: 24px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-hard: 0 24px 60px rgba(0, 0, 0, 0.55);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", "Segoe UI", "Trebuchet MS", Tahoma, sans-serif;
    background:
        radial-gradient(900px 600px at 12% -5%, rgba(255, 255, 255, 0.07), transparent 60%),
        radial-gradient(800px 600px at 100% 0%, rgba(255, 255, 255, 0.05), transparent 55%),
        radial-gradient(700px 500px at 50% 110%, rgba(255, 255, 255, 0.04), transparent 60%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
}

#starCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
}

.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: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    direction: ltr;
    background: rgba(10, 10, 10, 0.74);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 14px;
    z-index: 30;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.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 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.navbar-link:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.07);
}

.navbar-link.active {
    color: #000;
    background: var(--grad);
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.18);
}

.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: var(--paper-2);
    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: var(--grad);
}

.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: var(--paper-2);
    cursor: pointer;
    padding: 9px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    opacity: 0.85;
    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(2rem, 5vw, 3.4rem);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-transform: none;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    margin-bottom: 14px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--paper-2);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    backdrop-filter: blur(8px);
}

.hero-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.subtitle {
    margin: 10px auto 0;
    max-width: 740px;
    line-height: 1.6;
    color: var(--muted);
    font-size: 0.98rem;
}

.page-content {
    display: none;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hard);
    padding: 28px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.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: var(--paper);
    border: 1px solid var(--line);
    text-align: center;
    padding: 18px 14px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: 0.25s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
}

.stat-number {
    display: block;
    font-size: 2.1rem;
    font-weight: 900;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.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: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    padding: 18px;
    transition: 0.25s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.feature::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--grad);
    opacity: 0;
    transition: 0.25s ease;
}

.feature:hover {
    transform: translateY(-4px);
    border-color: var(--line-strong);
}

.feature:hover::after {
    opacity: 1;
}

.feature-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #000;
    background: var(--grad);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.18);
    margin-bottom: 12px;
}

.feature-icon i {
    width: 22px;
    height: 22px;
}

.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: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hard);
    padding: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.35rem;
    margin-bottom: 20px;
}

.card-title i {
    color: var(--accent-2);
    width: 22px;
    height: 22px;
}

.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: rgba(255, 255, 255, 0.04);
    padding: 12px 14px;
    transition: 0.2s ease;
}

.input-field::placeholder {
    color: rgba(149, 160, 187, 0.7);
}

.input-with-toggle .input-field {
    padding-right: 44px;
}

.input-field:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.toggle-visibility {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--paper-2);
    color: var(--muted);
    cursor: pointer;
}

.toggle-visibility i {
    width: 16px;
    height: 16px;
}

.progress-container {
    margin-bottom: 14px;
}

.progress-bar-wrap {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--grad);
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
    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%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 13px;
    background: var(--grad);
    background-size: 180% 180%;
    color: #000;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    padding: 13px;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 10px 24px rgba(255, 255, 255, 0.18);
}

.btn i {
    width: 18px;
    height: 18px;
}

.btn:hover {
    transform: translateY(-2px);
    background-position: right center;
    box-shadow: 0 14px 32px rgba(255, 255, 255, 0.28);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-stop {
    margin-top: 9px;
    color: #fff;
    background: linear-gradient(120deg, #3a3a3a, #1a1a1a);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.log-container {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(0, 0, 0, 0.28);
    color: var(--ink);
    max-height: 300px;
    overflow: auto;
    padding: 12px;
    font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

.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: var(--paper-2);
    color: var(--muted);
    border-radius: 8px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.log-btn:hover {
    color: var(--ink);
    border-color: var(--line-strong);
}

.log-btn i {
    width: 15px;
    height: 15px;
}

.log-entry {
    display: flex;
    gap: 8px;
    align-items: start;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.07);
    padding: 6px 0;
    font-size: 0.84rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.log-entry:last-child {
    border-bottom: 0;
}

.log-timestamp {
    color: #5d6b86;
    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-2); }

.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: var(--paper-2);
    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: #c2cadb;
}

.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: var(--paper-2);
    transition: 0.2s ease;
}

.faq-item:hover {
    border-color: var(--line-strong);
}

.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: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--ink);
    text-decoration: none;
    background: var(--paper-2);
    border: 1px solid var(--line);
    transition: 0.2s ease;
}

.social-link i {
    width: 20px;
    height: 20px;
}

.social-link:hover {
    transform: translateY(-3px);
    color: #000;
    border-color: transparent;
    background: var(--grad);
}

.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: linear-gradient(180deg, #131a2c, #0e1322);
    color: var(--ink);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line-strong);
    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: #000;
    background: var(--accent);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
    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(255, 255, 255, 0.14), transparent 40%),
        linear-gradient(180deg, #161616 0%, #0a0a0a 100%);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
    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(255, 255, 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: var(--ink);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.corner-ad-desc {
    margin: 0;
    color: var(--muted);
    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: #000;
    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(255, 255, 255, 0.18);
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}

.corner-ad-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.28);
}

.corner-ad-close {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(20, 27, 46, 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(13, 18, 33, 0.96);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: var(--shadow-soft);
        padding: 12px;
        backdrop-filter: blur(16px);
    }

    .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;
}

/* =========================================================
   LOGIN OVERLAY
   ========================================================= */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(800px 500px at 20% 0%, rgba(99, 102, 241, 0.25), transparent 60%),
        radial-gradient(700px 500px at 90% 100%, rgba(168, 85, 247, 0.22), transparent 60%),
        rgba(5, 8, 16, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.auth-overlay.open {
    display: flex;
    animation: reveal 0.3s ease;
}

.auth-card {
    width: min(420px, 96vw);
    background: linear-gradient(180deg, rgba(22, 29, 48, 0.95), rgba(13, 18, 33, 0.95));
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    box-shadow: var(--shadow-hard);
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--grad);
}

.auth-logo {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--grad);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
    color: white;
}

.auth-logo i {
    width: 28px;
    height: 28px;
}

.auth-card h2 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.auth-sub {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap > i {
    position: absolute;
    left: 13px;
    width: 18px;
    height: 18px;
    color: var(--muted);
    pointer-events: none;
}

.auth-input-wrap .input-field {
    padding-left: 42px;
}

.auth-error {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(251, 113, 133, 0.12);
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: var(--danger);
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.auth-error.show {
    display: flex;
}

.auth-error i {
    width: 16px;
    height: 16px;
}

.auth-hint {
    text-align: center;
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--muted);
}

.auth-hint code {
    background: var(--paper-2);
    border: 1px solid var(--line);
    padding: 2px 7px;
    border-radius: 6px;
    color: var(--accent-2);
}

/* =========================================================
   ADMIN PANEL
   ========================================================= */
#admin {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.admin-shell {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 16px;
}

.admin-side {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
    backdrop-filter: blur(14px);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.admin-side-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    padding: 4px 8px 12px;
}

.admin-nav-btn {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    padding: 11px 12px;
    border-radius: 11px;
    cursor: pointer;
    transition: 0.2s ease;
    margin-bottom: 3px;
}

.admin-nav-btn i {
    width: 18px;
    height: 18px;
}

.admin-nav-btn:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.admin-nav-btn.active {
    background: var(--grad);
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.admin-logout {
    margin-top: 12px;
    color: var(--danger);
}

.admin-logout:hover {
    background: rgba(251, 113, 133, 0.12);
    color: var(--danger);
}

.admin-main {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px;
    backdrop-filter: blur(14px);
    min-height: 420px;
}

.admin-section { display: none; }
.admin-section.active { display: block; animation: reveal 0.3s ease; }

.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.admin-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.admin-head h2 i {
    width: 24px;
    height: 24px;
    color: var(--accent-2);
}

.admin-head p {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 2px;
}

/* Dashboard cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.admin-stat {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.admin-stat-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--grad);
    color: white;
    margin-bottom: 12px;
}

.admin-stat-icon i { width: 21px; height: 21px; }

.admin-stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
}

.admin-stat-label {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 6px;
    font-weight: 600;
}

.admin-card {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
    margin-bottom: 16px;
}

.admin-card h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 1.08rem;
    margin-bottom: 4px;
}

.admin-card h3 i { width: 19px; height: 19px; color: var(--accent-2); }

.admin-card .admin-card-sub {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 18px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.admin-field { margin-bottom: 16px; }

.admin-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--ink);
}

.admin-field textarea.input-field {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.btn-secondary {
    width: auto;
    padding: 11px 20px;
    background: var(--paper-2);
    border: 1px solid var(--line-strong);
    color: var(--ink);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.btn-inline {
    width: auto;
    padding: 11px 22px;
}

/* Toggle switch */
.admin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.admin-toggle-row:last-child { border-bottom: 0; }

.admin-toggle-row .toggle-info strong {
    display: block;
    font-size: 0.95rem;
}

.admin-toggle-row .toggle-info span {
    color: var(--muted);
    font-size: 0.82rem;
}

.switch {
    position: relative;
    width: 48px;
    height: 27px;
    flex-shrink: 0;
    cursor: pointer;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch .slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    transition: 0.25s ease;
}

.switch .slider::before {
    content: "";
    position: absolute;
    width: 21px;
    height: 21px;
    left: 3px;
    top: 3px;
    border-radius: 50%;
    background: white;
    transition: 0.25s ease;
}

.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(21px); }

/* Live ad preview */
.admin-preview {
    background: var(--bg-1);
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    padding: 22px;
    display: grid;
    place-items: center;
    min-height: 160px;
    position: relative;
}

.admin-preview-label {
    position: absolute;
    top: 10px;
    left: 14px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
}

.preview-ad {
    width: 320px;
    max-width: 100%;
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.25), transparent 40%),
        linear-gradient(180deg, #141b2e 0%, #0e1322 100%);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
}

.preview-ad img {
    width: 96px;
    object-fit: cover;
    flex-shrink: 0;
}

.preview-ad .pa-body {
    padding: 13px 15px;
    flex: 1;
    min-width: 0;
}

.preview-ad .pa-badge {
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.preview-ad .pa-title {
    font-weight: 800;
    margin: 5px 0 4px;
}

.preview-ad .pa-desc {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.preview-ad .pa-btn {
    display: inline-block;
    margin-top: 10px;
    background: var(--grad);
    color: white;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.76rem;
    font-weight: 800;
}

.admin-saved-flash {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-saved-flash.show { opacity: 1; }
.admin-saved-flash i { width: 16px; height: 16px; }

.navbar-link.admin-link {
    border: 1px solid var(--line-strong);
}

@media (max-width: 820px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .admin-side-title { width: 100%; }
    .admin-nav-btn { width: auto; margin-bottom: 0; }
    .admin-grid-2 { grid-template-columns: 1fr; }
}
