:root {
    --bg-background: linear-gradient(0deg, #121212, #0a0a0a 100%);
    --bg-primary: #191919;
    --bg-secondary: #191919;
    --bg-tertiary: #202020;
    --card-bg: #191919;
    --border-color: #2b2d2f;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --primary: #686868;
    --primary-hover: #888888;
    --secondary: #3B7B5E;
    --secondary-hover: #3b906a;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --gradient-primary: linear-gradient(135deg, #878787 0%, #bebebe 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --transition: all 0.2s ease;
}

* {
    padding: 0;
    margin: 0;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    text-rendering: optimizeLegibility;
    box-sizing: border-box;

    scrollbar-width: thin;
    scrollbar-color: #121212 #121212;
}

body,
button,
input,
select,
textarea {
    font-family: 'Manrope', 'Montserrat', 'Inter', sans-serif;
}

input {
    min-height: 42px;
}

html {
    background: var(--bg-background);
    min-height: 100vh;
}

body {
    background: transparent;
    /* Background is now on html */
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    position: relative;
}

/* Default state for standard browsers */
#app-scroller {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Prevent Mini App from collapsing on iOS when scrolling */
html.is-telegram,
html.is-telegram body {
    height: 100%;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

html.is-telegram #app-scroller {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
    /* Re-enable bounce for iOS */
}

/* Ensure content takes available space and footer pushes down */
.main-content {
    flex: 1;
}

/* Reset main-content overrides from previous attempt */
html.is-telegram .main-content {
    flex: none;
    overflow: visible;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.05;
    z-index: -1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='500'%3E%3Cfilter id='noise' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeBlend mode='screen'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

a {
    color: var(--primary);
}

.text-secondary {
    color: var(--text-secondary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.navbar {
    position: sticky;
    top: calc(1rem + env(safe-area-inset-top, 0px));
    z-index: 100;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-tertiary);
    padding: 0 1rem;
    box-shadow: 0px 6px 12px -1px rgba(0, 0, 0, 0.18), 0px 12px 24px -1px rgba(0, 0, 0, 0.14);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-image {
    height: 28px;
    width: auto;
}

.login-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    padding: 1.5rem;
    max-width: 450px;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-tertiary);
}

.login-logo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.login-logo {
    height: 48px;
    width: auto;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.oauth-button-wrapper {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.btn-github {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #24292e;
    color: var(--text-primary);
    padding: 0.875rem 1.5rem !important;
    border-radius: 12px !important;
    font-weight: 600;
    text-decoration: none;
}

.btn-google {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: white;
    color: #3c4043 !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 12px !important;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #dadce0 !important;
}

@media (hover: hover) {
    .btn-google:hover {
        background: #f8f9fa;
        box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.30), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    }
}

.btn-icon {
    flex-shrink: 0;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.text-muted {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropbtn {
    background: transparent;
    color: var(--text-primary);
    padding: 0.4rem;
    border: 0;
    border-radius: var(--radius-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.lang-dropdown-content .fi {
    margin-right: 0.4rem;
}

.lang-dropbtn .drop-icon {
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.lang-dropdown.active .drop-icon {
    transform: rotate(180deg);
}

.lang-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-tertiary);
    min-width: 120px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    z-index: 1000;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.lang-dropdown.active .lang-dropdown-content {
    display: block;
}

.lang-dropdown-content a {
    color: var(--text-primary);
    padding: 0.4rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    transition: var(--transition);
}

@media (hover: hover) {
    .lang-dropdown-content a:hover {
        background: var(--bg-secondary);
        color: var(--primary);
    }
}

.lang-dropdown-content a.active {
    background: var(--bg-secondary);
    color: var(--primary);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-grid-simple {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.stats-item-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stats-label-simple {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stats-value-simple {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.nodes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.node-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

@media (hover: hover) {
    .node-row:hover {
        border-color: var(--primary);
        transform: translateX(4px);
    }
}

.node-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.node-emoji {
    font-size: 1.25rem;
}

.node-name {
    font-weight: 500;
    color: var(--text-primary);
}

.node-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.node-users {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stats-footer {
    margin-top: 1.5rem;
    text-align: right;
    padding-right: 0.5rem;
}

@media (max-width: 600px) {
    .node-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .node-meta {
        width: 100%;
        justify-content: space-between;
    }
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

@media (hover: hover) {
    .nav-link:hover {
        color: var(--primary);
    }
}

.nav-icon-link {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0.4rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-icon-link svg {
    width: 22px;
    height: 22px;
    transition: var(--transition);
}

.nav-icon-link.active {
    color: var(--primary);
}

@media (hover: hover) {
    .nav-icon-link:hover {
        color: var(--primary);
    }
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip-pos="top"]::after {
    bottom: auto;
    top: -32px;
    transform: translateX(-50%) translateY(-5px);
}

@media (hover: hover) {
    [data-tooltip]:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    [data-tooltip-pos="top"]:hover::after {
        transform: translateX(-50%) translateY(0);
    }
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.btn {
    display: flex;
    padding: 0 1rem;
    border-radius: var(--radius-xl);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 13.333px;
    height: 42px;
    align-items: center;
    white-space: nowrap;
}

.btn:hover {
    border-color: var(--primary);
}

.btn-primary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-login {
    height: 30px;
    padding: 0 0.6rem;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.btn-success {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-warning {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-danger {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-xl);
}

.config-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.selection-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.method-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 4px;
    gap: 4px;
    height: 42px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.primary-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.action-buttons .btn {
    flex-grow: 1;
    white-space: nowrap;
}


.secondary-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .selection-row {
        flex-direction: column;
        align-items: stretch;
    }

    .method-toggle {
        justify-content: center;
    }

    .action-buttons {
        flex-direction: column;
    }
}


.method-btn {
    border: none !important;
    background: transparent !important;
    color: var(--text-secondary);
    padding: 0 0.4rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md) !important;
    transition: var(--transition);
    cursor: pointer;
    height: auto;
}

.method-btn.active {
    background: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.method-btn:hover:not(.active) {
    background: var(--border-color) !important;
    color: var(--text-primary);
}

.error-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.error-content {
    text-align: center;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1;
}

.error-title {
    font-size: 2rem;
    margin: 1rem 0;
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

.hero {
    padding: 2rem 0;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-servers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.server-badge {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    line-height: normal;
    cursor: default;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    margin-left: 8px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    animation: blink-opacity 2s ease-in-out infinite;
}

@keyframes blink-opacity {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

.flag {
    margin-right: 8px;
    line-height: 1;
    flex-shrink: 0;
}

.flag.fi {
    width: 1.15em;
    height: 0.85em;
    border-radius: 2px;
}

.more-servers {
    border-style: dashed;
    opacity: 0.8;
}

@media (hover: hover) {
    .server-badge:hover {
        border-color: var(--primary);
        color: var(--text-primary);
    }

    .more-servers:hover {
        border-style: solid;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .hero-servers {
        display: grid;
    }

    .server-badge {
        justify-content: center;
        width: 100%;
    }

    .more-servers {
        grid-column: span 2;
        justify-self: center;
        width: fit-content;
    }
}

.hero-content {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--bg-tertiary);
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}


.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-tertiary);
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.feature-icon {
    color: var(--primary);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--bg-tertiary);
}

.feature-title {
    font-size: 1rem;
    overflow-wrap: anywhere;
    hyphens: auto;
    word-break: normal;
}

.feature-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dashboard {
    padding: 1rem 0;
}

.dashboard-title {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.dashboard-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
}

.dashboard-header {
    margin-bottom: 1rem;
}

.card {
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-tertiary);
}

.card-full-width-admin {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr 1fr;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
}

.card-title {
    font-size: 1.1rem;
}

.card-body {
    padding: 1rem;
}

.user-info-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.profile-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    border: 2px solid var(--primary);
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--primary), #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.provider-icon {
    position: absolute;
    bottom: 9px;
    right: 3px;
    width: 17px;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.profile-name {
    font-size: 1.35rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.profile-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
}

.subscription-info-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.status-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-dot-large {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    animation: blink-opacity 2s ease-in-out infinite;
}

.status-text {
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value.highlight {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--success);
}

.expiry-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.expiry-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.expiry-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
}

.no-subscription-box {
    background: linear-gradient(135deg, rgba(59, 123, 94, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px dashed var(--primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.no-sub-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.no-sub-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Download Section */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.footer-text svg {
    width: 16px;
    height: 16px;
    display: flex;
    fill: #b12d2d;
}

.footer-text p {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0.2rem;
    width: 100%;
    justify-content: center;
}

.download-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download-platform {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.download-platform svg {
    color: var(--primary);
}

.download-apps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.download-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    padding: 0 1rem;
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid transparent;
    transition: var(--transition);
    height: 42px;
}

.download-link:hover {
    border-color: var(--primary) !important;
}

.app-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.download-btn-small {
    font-size: 0.75rem;
    border-radius: var(--radius-md);
}

.download-link.happ-link {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.05);
}

.download-link.happ-link::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
    width: 50px;
    height: 50px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_36_75)'%3E%3Cpath d='M69.9844 77.873L56 77.8955L56.5176 72.4248L71.8096 57L69.9844 77.873Z' fill='white'/%3E%3Cpath d='M41.9844 77.0117L28 77.0342L28.3486 73.3428L43.6562 57.9033L41.9844 77.0117Z' fill='white'/%3E%3Cpath d='M70.3096 56.1045L55.0176 71.5293L56.3936 57H44.5518L56.4492 45H57.5293L57.6426 43.7949L72.7168 28.5908L70.3096 56.1045Z' fill='white'/%3E%3Cpath d='M44.4365 42.8203H56.1006L44.2031 54.8203H43.3867L43.3076 55.7236L28 71.1631L30.3906 45.9072L45.499 30.668L44.4365 42.8203Z' fill='white'/%3E%3Cpath d='M72.3682 26.4111L57.2939 41.6152L59.1514 22H72.7549L72.3682 26.4111Z' fill='white'/%3E%3Cpath d='M43.1084 30.6338L28 45.873L30.2607 22H43.8643L43.1084 30.6338Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_36_75'%3E%3Crect width='100' height='100' rx='20' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

.download-link.v2-link {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.05);
}

.download-link.v2-link::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='100' height='100' viewBox='0 0 100 100' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_35_2)'%3E%3Cpath d='M23.5417 35C26.5667 35 30.2167 35 33.3333 35C33.7467 36.24 33.897 37.3017 34.0348 38.5986C34.0857 39.0686 34.1365 39.5386 34.1888 40.0228C34.2681 40.7721 34.2681 40.7721 34.349 41.5365C34.4599 42.5581 34.5711 43.5797 34.6826 44.6012C34.7367 45.0977 34.7907 45.5942 34.8464 46.1058C35.0431 47.8913 35.2496 49.6754 35.4687 51.4583C35.53 51.9611 35.5912 52.4638 35.6543 52.9818C35.803 54.1943 35.803 54.1943 36.25 55.4167C37.0873 53.5808 37.924 51.7447 38.7601 49.9082C39.0431 49.2868 39.3263 48.6655 39.6097 48.0442C41.5852 43.7129 43.5178 39.3656 45.4167 35C48.5792 35 51.7417 35 55 35C54.3625 36.9126 53.7053 38.5242 52.8099 40.3082C52.6756 40.5768 52.5414 40.8454 52.4031 41.1221C51.9628 42.0021 51.5202 42.881 51.0775 43.7598C50.7702 44.3727 50.4632 44.9857 50.1562 45.5987C49.3508 47.2064 48.5433 48.8131 47.7355 50.4196C46.9103 52.0614 46.0871 53.7041 45.2637 55.3467C43.6499 58.5654 42.0338 61.7829 40.4167 65C36.5667 65 32.7167 65 28.75 65C27.8958 60.1433 27.0446 55.2861 26.1985 50.4281C25.9772 49.1573 25.7551 47.8866 25.5316 46.6162C25.2909 45.2446 25.0536 43.8724 24.8177 42.5C24.7496 42.1162 24.6815 41.7325 24.6114 41.3371C24.5511 40.9818 24.4908 40.6265 24.4287 40.2604C24.3774 39.965 24.3262 39.6696 24.2734 39.3652C24.1237 37.9174 23.75 36.4583 23.5417 35Z' fill='%23FAFAFA'/%3E%3Cpath d='M76.25 35.8334C78.1331 37.3449 79.414 38.592 79.7119 41.0694C79.88 44.9752 78.7842 47.1336 76.3167 50.083C73.4494 53.1485 69.6167 56.4417 65.8333 58.3334C71.6083 58.5396 71.6083 58.5396 77.5 58.75C77.225 60.8125 76.95 62.875 76.6667 65C68.9667 65 61.2667 65 53.3333 65C53.75 59.1667 53.75 59.1667 55.1676 57.6026C55.7853 57.1935 56.4163 56.8039 57.0573 56.4323C57.7395 55.9895 58.4215 55.5463 59.1032 55.1026C59.4561 54.8823 59.8091 54.662 60.1727 54.4351C61.9526 53.3033 63.6553 52.0681 65.3646 50.8334C65.6788 50.6134 65.9929 50.3934 66.3166 50.1668C68.2023 48.8259 69.7758 47.5317 70.8333 45.4167C71.0037 43.4822 71.2412 42.2148 70.3906 41.6927C69.375 41.0694 67.1958 41.1442 65.4948 41.4844C64.2108 42.1862 64.2108 42.1862 63.75 45C61.1375 45 58.525 45 55.8333 45C56.3453 41.416 57.5111 39.206 60.3385 36.9271C64.5953 34.052 71.6471 33.1208 76.25 35.8334Z' fill='%23FAFAFA'/%3E%3Crect x='22.9167' y='62.9165' width='0.416667' height='4.58333' fill='%236C6C6C'/%3E%3Crect x='25.4167' y='65' width='0.416667' height='4.58333' transform='rotate(90 25.4167 65)' fill='%236C6C6C'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_35_2'%3E%3Crect width='100' height='100' rx='20' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -1;
    pointer-events: none;
}

.config-group {
    margin-bottom: 1.25rem;
}

.config-group:last-child {
    margin-bottom: 0;
}

.config-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.config-url {
    flex: 1;
    height: 42px;
    padding: 0 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    min-width: 0;
    transition: var(--transition);
}

.config-url:focus {
    border-color: var(--primary);
    outline: none;
}

.config-url-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.config-url-container .btn {
    height: 42px;
    padding: 0 1rem;
    font-size: 0.85rem;
    border-radius: var(--radius-xl);
}

.config-url:focus-visible {
    outline: 0;
}

.config-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    align-items: center;
    padding: 0.2rem 0.6rem;
    height: 32px;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.info-value {
    font-size: 0.85rem;
}



.manual-links-container {
    display: grid;
    gap: 0.5rem;
}

.manual-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.manual-link-item:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.02);
}

.manual-link-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.protocol-badge {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.link-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.link-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.link-snippet {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.refresh-configs-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.refresh-configs-btn:hover {
    color: var(--primary);
}

.rotating svg {
    animation: rotate 1s linear infinite;
}

.plan-selector {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.select-premium {
    width: 100%;
    height: 42px;
    font-size: 13.333px;
    padding: 0 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 1rem) center;
}

.select-premium:hover {
    border-color: var(--primary);
}

.select-premium:focus {
    outline: none;
}

.plan-selector .payment-btn {
    width: fit-content;
    white-space: nowrap;
}

.footer {
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.footer-icon-link {
    color: var(--text-secondary);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.footer-icon-link:hover {
    color: var(--primary);
}

.footer-icon-link svg {
    width: 21px;
    height: 21px;
}

.legal-page {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.legal-page .container {
    max-width: 800px;
    width: 100%;
}

.legal-section {
    margin-bottom: 1.5rem;
}

.section-subtitle {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.legal-footer {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .container {
        padding: 0 0.75rem;
    }

    .user-name {
        display: none;
    }

    .logo-text {
        display: none;
    }

    .login-container {
        padding: 0 0.75rem;
    }

    .footer-links {
        justify-content: center;
    }

    .footer .container {
        flex-direction: column;
    }

    .protocol-badge {
        display: none;
    }

    .link-name {
        font-size: 0.8rem !important;
    }

    .admin-dashboard {
        padding: 0 0.75rem !important;
    }

    .plan-selector {
        flex-direction: column;
    }

    .plan-selector .payment-btn {
        width: 100%;
    }

    .navbar {
        top: 0;
    }

    .navbar .container {
        padding: 0;
    }

    .navbar-inner {
        border: 0;
        border-radius: 0;
        border-bottom: 1px solid var(--bg-tertiary);
        box-shadow: none;
    }

    .main-content {
        padding: 1rem 0;
    }

    .card-full-width-admin {
        grid-template-columns: 1fr;
    }
}

.faq-section {
    margin-bottom: 3rem;
    padding-top: 1rem;
}

.faq-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    color: var(--text-primary);
}

.faq-item {
    margin-bottom: 2rem;
}

.faq-item h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.faq-item ol,
.faq-item ul {
    margin-left: 1.5rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.faq-item ol li {
    margin-bottom: 0.75rem;
}

.faq-image-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
}

.faq-image-container img {
    max-width: 100%;
    height: auto;
}

.faq-note {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
}

.faq-note p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.faq-note strong {
    color: var(--primary);
}



@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Collapsible Cards */
.collapsible-card {
    overflow: hidden;
}

.collapsible-card .card-header,
.config-header {
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.config-header:hover {
    opacity: 0.8;
}

.collapsible-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
}

.collapsible-card.expanded .card-header {
    border-bottom-color: var(--bg-tertiary);
}

.toggle-icon,
.refresh-configs-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xl);
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.toggle-icon:hover,
.refresh-configs-btn:hover {
    color: var(--primary);
}

.collapsible-card.expanded .toggle-icon {
    transform: rotate(180deg);
    color: var(--accent-primary);
}

.collapsible-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapsible-card.expanded .collapsible-wrapper {
    grid-template-rows: 1fr;
}

.collapsible-content {
    overflow: hidden;
    min-height: 0;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.collapsible-card.expanded .collapsible-content {
    opacity: 1;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    padding-left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    min-width: 250px;
    max-width: 400px;
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.toast-success {
    border: 1px solid #10b981;
}

.toast-error {
    border: 1px solid #ef4444;
}

.toast-info {
    border: 1px solid var(--primary);
}

.toast-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.toast-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin-left: auto;
}

@media (hover: hover) {
    .toast-close:hover {
        color: var(--text-primary);
    }
}

.animate-fade-in {
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-fade-out {
    animation: fadeOut 0.3s forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}


.admin-dashboard {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 0.75rem;
}

.admin-user-cell {
    display: flex;
    align-items: center;
}

.clickable {
    cursor: pointer;
}

.user-name-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

@media (hover: hover) {
    .user-name-link:hover {
        color: var(--primary);
        text-decoration: underline;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-tertiary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
    hyphens: auto;
    word-break: normal;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-primary {
    background: rgba(59, 123, 94, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 123, 94, 0.2);
}

.badge-secondary {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--bg-tertiary);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

@media (hover: hover) {
    .modal-close:hover {
        color: var(--text-primary);
        border-color: var(--primary);
    }
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--bg-tertiary);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.detail-item {
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.modal-action-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-input-sm {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0 1rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition);
}

.admin-input-sm:focus {
    border-color: var(--primary);
    outline: none;
}

.action-section {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.action-section:last-child {
    margin-bottom: 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.rotating svg {
    animation: rotate 1s linear infinite;
}