/* ================================================================
   netmod-theme.css  —  shared styles for login & profile pages
   Bootstrap 5.2 companion  |  supports data-bs-theme dark/light
   ================================================================ */

/* ── CSS Variables ─────────────────────────────────────────────── */
[data-bs-theme="dark"] {
    --nm-accent:        #00e5a0;
    --nm-accent2:       #0099ff;
    --nm-grid:          rgba(0, 229, 160, .03);
    --nm-orb1:          rgba(0, 229, 160, .06);
    --nm-orb2:          rgba(0, 153, 255, .05);
    --nm-row-hover:     rgba(255, 255, 255, .025);
    --nm-progress-bg:   rgba(255, 255, 255, .07);
    --nm-qr-hover-glow: rgba(0, 229, 160, .35);
    --nm-input-focus:   rgba(0, 229, 160, .25);
}

[data-bs-theme="light"] {
    --nm-accent:        #00a672;
    --nm-accent2:       #0070cc;
    --nm-grid:          rgba(0, 120, 80, .04);
    --nm-orb1:          rgba(0, 140, 90, .06);
    --nm-orb2:          rgba(0, 100, 200, .05);
    --nm-row-hover:     rgba(0, 0, 0, .02);
    --nm-progress-bg:   rgba(0, 0, 0, .06);
    --nm-qr-hover-glow: rgba(0, 166, 114, .3);
    --nm-input-focus:   rgba(0, 166, 114, .2);
}

/* ── Background: grid + orbs ───────────────────────────────────── */
.nm-bg-grid {
    min-height: 100vh;
    position: relative;
}

.nm-bg-grid::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--nm-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--nm-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.nm-orb1,
.nm-orb2 {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.nm-orb1 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--nm-orb1) 0%, transparent 70%);
    top: -200px; right: -200px;
}

.nm-orb2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--nm-orb2) 0%, transparent 70%);
    bottom: -150px; left: -150px;
}

/* ── Logo gradient text ────────────────────────────────────────── */
.nm-logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--nm-accent), var(--nm-accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nm-logo-icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--nm-accent), var(--nm-accent2));
    box-shadow: 0 0 18px color-mix(in srgb, var(--nm-accent) 35%, transparent);
}

/* ── Status badge pulse dot ────────────────────────────────────── */
.nm-pulse {
    width: 8px; height: 8px;
    background: var(--nm-accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: nmPulse 2s infinite;
}

/* ── Card rounded ──────────────────────────────────────────────── */
.nm-card {
    border-radius: 1.25rem !important;
    border: 1px solid var(--bs-border-color) !important;
    box-shadow: var(--bs-box-shadow-sm) !important;
    overflow: hidden;
}

/* ── Profile: row hover ────────────────────────────────────────── */
.nm-profile-row {
    border-bottom: 1px solid var(--bs-border-color);
    transition: background .15s;
}

.nm-profile-row:last-child { border-bottom: none; }
.nm-profile-row:hover      { background: var(--nm-row-hover); }

/* ── Password copy span ────────────────────────────────────────── */
.nm-pass-copy {
    cursor: pointer;
    border-radius: .375rem;
    transition: background .15s;
    direction: ltr;
}

.nm-pass-copy:hover { background: var(--nm-row-hover); }

.nm-pass-mask {
    letter-spacing: 3px;
    font-size: .95rem;
}

/* ── Progress bar ──────────────────────────────────────────────── */
.nm-progress-track {
    height: 6px;
    background: var(--nm-progress-bg);
    border-radius: 100px;
    overflow: hidden;
}

.nm-progress-fill {
    height: 100%;
    border-radius: 100px;
    animation: nmFillBar 1.2s ease both .5s;
    transform-origin: right;
}

/* ── Protocol badges ───────────────────────────────────────────── */
.nm-tag-v2ray {
    background: rgba(124, 58, 237, .12);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, .25);
}

.nm-tag-openvpn {
    background: color-mix(in srgb, var(--nm-accent2) 10%, transparent);
    color: var(--nm-accent2);
    border: 1px solid color-mix(in srgb, var(--nm-accent2) 25%, transparent);
}

.nm-tag-ssh {
    background: color-mix(in srgb, var(--nm-accent) 10%, transparent);
    color: var(--nm-accent);
    border: 1px solid color-mix(in srgb, var(--nm-accent) 25%, transparent);
}

.nm-tag-app {
    background: rgba(245, 158, 11, .10);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, .25);
}

/* ── Config tab buttons ────────────────────────────────────────── */
.nm-tab-btn {
    border-radius: .5rem .5rem 0 0 !important;
    border-bottom: 2px solid transparent !important;
    margin-bottom: -1px;
}

.nm-tab-btn.active {
    color: var(--nm-accent) !important;
    border-bottom-color: var(--nm-accent) !important;
    background: color-mix(in srgb, var(--nm-accent) 6%, transparent) !important;
}

.nm-tab-content      { display: none; }
.nm-tab-content.active { display: block; }

/* ── QR image box ──────────────────────────────────────────────── */
.nm-qr-box {
    background: white;
    border-radius: .625rem;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--bs-border-color);
    transition: transform .2s, box-shadow .2s;
}

.nm-qr-box:hover {
    transform: scale(1.06);
    box-shadow: 0 0 16px var(--nm-qr-hover-glow);
}

.nm-qr-box img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── OpenVPN download link ─────────────────────────────────────── */
.nm-ovpn-item {
    background: color-mix(in srgb, var(--nm-accent2) 5%, var(--bs-body-bg));
    border-color: color-mix(in srgb, var(--nm-accent2) 15%, transparent) !important;
    color: var(--nm-accent2);
    transition: transform .15s, background .15s;
    text-decoration: none;
}

.nm-ovpn-item:hover {
    transform: translateX(-3px);
    background: color-mix(in srgb, var(--nm-accent2) 10%, transparent) !important;
    color: var(--nm-accent2);
    text-decoration: none;
}

/* ── SSH list item ─────────────────────────────────────────────── */
.nm-ssh-item {
    background: var(--bs-tertiary-bg);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.nm-ssh-item:hover {
    border-color: color-mix(in srgb, var(--nm-accent) 40%, transparent) !important;
    background: color-mix(in srgb, var(--nm-accent) 5%, transparent) !important;
}

/* ── Scroll area ───────────────────────────────────────────────── */
.nm-scroll {
    max-height: 420px;
    overflow-y: auto;
}

.nm-scroll::-webkit-scrollbar       { width: 4px; }
.nm-scroll::-webkit-scrollbar-thumb { background: var(--bs-border-color); border-radius: 4px; }

/* ── Config section label ──────────────────────────────────────── */
.nm-section-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ── Accent buttons (copy / vmess / vless) ─────────────────────── */
.nm-btn-accent {
    font-size: .7rem;
    color: var(--nm-accent);
    background: color-mix(in srgb, var(--nm-accent) 10%, transparent);
    border-color: color-mix(in srgb, var(--nm-accent) 25%, transparent) !important;
    transition: background .15s, transform .15s;
}

.nm-btn-accent:hover {
    background: color-mix(in srgb, var(--nm-accent) 18%, transparent);
    color: var(--nm-accent);
    transform: translateY(-1px);
}

.nm-btn-accent2 {
    font-size: .7rem;
    color: var(--nm-accent2);
    background: color-mix(in srgb, var(--nm-accent2) 10%, transparent);
    border-color: color-mix(in srgb, var(--nm-accent2) 25%, transparent) !important;
    transition: background .15s, transform .15s;
}

.nm-btn-accent2:hover {
    background: color-mix(in srgb, var(--nm-accent2) 18%, transparent);
    color: var(--nm-accent2);
    transform: translateY(-1px);
}

/* ── Login: input focus glow ───────────────────────────────────── */
.nm-input:focus {
    border-color: var(--nm-accent) !important;
    box-shadow: 0 0 0 .2rem var(--nm-input-focus) !important;
    outline: none;
}

/* ── Login: submit button ──────────────────────────────────────── */
.nm-btn-submit {
    background: linear-gradient(135deg, var(--nm-accent), var(--nm-accent2));
    border: none;
    color: #000;
    font-weight: 700;
    letter-spacing: .03em;
    transition: opacity .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 4px 18px color-mix(in srgb, var(--nm-accent) 30%, transparent);
}

.nm-btn-submit:hover {
    opacity: .9;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px color-mix(in srgb, var(--nm-accent) 40%, transparent);
    color: #000;
}

.nm-btn-submit:active {
    transform: translateY(0);
}

/* ── Toast notification ────────────────────────────────────────── */
.nm-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--nm-accent);
    color: #000;
    padding: 9px 22px;
    border-radius: 100px;
    font-weight: 700;
    font-size: .8rem;
    opacity: 0;
    transition: opacity .3s, transform .3s;
    z-index: 9999;
    pointer-events: none;
}

.nm-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Animations ────────────────────────────────────────────────── */
@keyframes nmFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes nmFadeDown {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes nmPulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--nm-accent) 45%, transparent); }
    50%       { box-shadow: 0 0 0 5px transparent; }
}

@keyframes nmFillBar {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.nm-anim-1 { animation: nmFadeUp   .55s ease both; }
.nm-anim-2 { animation: nmFadeUp   .55s ease both .1s; }
.nm-anim-3 { animation: nmFadeDown .55s ease both; }
.nm-anim-login { animation: nmFadeUp .6s ease both .05s; }