/* ============================================================
   proxy/style.css — the Proxy agent's own look (no shared CSS)
   ============================================================ */

:root {
    --p-bg:        #0a0e14;
    --p-bg-2:      #0f1520;
    --p-card:      #111a29;
    --p-card-hi:   #16223a;
    --p-line:      #22304a;
    --p-text:      #e6edf7;
    --p-text-dim:  #8fa1bd;
    --p-text-mute: #5b6c89;
    --p-accent:    #2dd4bf;
    --p-accent-2:  #38bdf8;
    --p-danger:    #fb7185;
    --p-radius:    14px;
    --p-shadow:    0 10px 34px rgba(0, 0, 0, 0.45);
    --p-font:      "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --p-mono:      "Cascadia Code", "JetBrains Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
    font-family: var(--p-font);
    background:
        radial-gradient(1000px 500px at 80% -10%, rgba(45, 212, 191, 0.10), transparent 60%),
        radial-gradient(800px 400px at 0% 0%, rgba(56, 189, 248, 0.08), transparent 55%),
        var(--p-bg);
    color: var(--p-text);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--p-bg-2); }
::-webkit-scrollbar-thumb { background: var(--p-line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--p-accent); }

/* ============================================================
   Shared navbar (rendered by js/shared.js — styled locally)
   ============================================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 58px;
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--p-line);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 28px;
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(90deg, var(--p-accent), var(--p-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.navbar-logo svg { -webkit-text-fill-color: currentColor; }

.navbar-links { display: flex; align-items: center; gap: 4px; flex: 1; }

.nav-link {
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--p-text-dim);
    transition: all 0.16s ease;
    display: flex;
    align-items: center;
    gap: 7px;
}

.nav-link:hover { background: rgba(45, 212, 191, 0.10); color: var(--p-text); }
.nav-link.active { background: rgba(45, 212, 191, 0.16); color: var(--p-accent); font-weight: 650; }
.nav-link.disabled { opacity: 0.35; pointer-events: none; }

.nav-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--p-accent), var(--p-accent-2));
    color: #06231f;
    line-height: 1;
}

@media (max-width: 560px) {
    .navbar { padding: 0 14px; gap: 14px; }
    .navbar-links .nav-link span { display: none; }
}

/* ============================================================
   Page shell
   ============================================================ */

.proxy-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 34px 24px 28px;
}

.proxy-header { text-align: center; margin-bottom: 26px; }

.proxy-title {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(90deg, var(--p-text) 45%, var(--p-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.proxy-subtitle {
    color: var(--p-text-dim);
    font-size: 0.95rem;
    max-width: 520px;
    margin: 10px auto 0;
    line-height: 1.55;
}

/* ============================================================
   Toolbar
   ============================================================ */

.toolbar {
    background: var(--p-card);
    border: 1px solid var(--p-line);
    border-radius: var(--p-radius);
    padding: 12px;
    position: sticky;
    top: 66px;
    z-index: 100;
    box-shadow: var(--p-shadow);
}

.toolbar-row { display: flex; align-items: center; gap: 8px; }

.tb-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid var(--p-line);
    background: var(--p-bg-2);
    color: var(--p-text-dim);
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.tb-btn:hover { color: var(--p-accent); border-color: var(--p-accent); transform: translateY(-1px); }
.tb-btn:active { transform: translateY(0); }

.address-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.address-form input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--p-line);
    background: var(--p-bg-2);
    color: var(--p-text);
    font-family: var(--p-mono);
    font-size: 0.86rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.address-form input::placeholder { color: var(--p-text-mute); }

.address-form input:focus {
    border-color: var(--p-accent);
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}

.go-btn {
    height: 38px;
    padding: 0 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #06231f;
    background: linear-gradient(90deg, var(--p-accent), var(--p-accent-2));
    transition: filter 0.15s ease, transform 0.15s ease;
}

.go-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--p-line);
}

.quick-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--p-bg-2);
    border: 1px solid var(--p-line);
    color: var(--p-text-dim);
    transition: all 0.15s ease;
}

.quick-link:hover { color: var(--p-accent); border-color: var(--p-accent); transform: translateY(-1px); }

/* ============================================================
   Viewport
   ============================================================ */

.viewport-wrap {
    position: relative;
    height: calc(100vh - 290px);
    min-height: 420px;
    margin-top: 16px;
    border-radius: var(--p-radius);
    border: 1px solid var(--p-line);
    overflow: hidden;
    background: #0b0e16;
    box-shadow: var(--p-shadow);
}

.viewport-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
    display: block;
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(10, 14, 20, 0.92);
    backdrop-filter: blur(4px);
    text-align: center;
    padding: 24px;
}

.hidden { display: none !important; }

.spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid var(--p-line);
    border-top-color: var(--p-accent);
    animation: p-spin 0.8s linear infinite;
}

@keyframes p-spin { to { transform: rotate(360deg); } }

#statusText { color: var(--p-text-dim); font-size: 0.9rem; }

.error-icon { font-size: 2.2rem; }

.error-box h3 { font-size: 1.15rem; margin-bottom: 6px; }

.error-box p { color: var(--p-text-dim); font-size: 0.85rem; line-height: 1.5; max-width: 400px; margin: 0 auto; }

.error-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 650;
    transition: all 0.15s ease;
}

.btn.ghost {
    background: var(--p-bg-2);
    border: 1px solid var(--p-line);
    color: var(--p-text-dim);
}

.btn.ghost:hover { color: var(--p-text); border-color: var(--p-accent); }

/* ============================================================
   Footer
   ============================================================ */

.proxy-footer {
    margin-top: 20px;
    text-align: center;
    color: var(--p-text-mute);
    font-size: 0.78rem;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 640px) {
    .proxy-shell { padding: 22px 14px 20px; }
    .viewport-wrap { height: calc(100vh - 330px); }
    .toolbar-row { flex-wrap: wrap; }
    .tb-btn { width: 36px; height: 36px; }
    .address-form { order: 10; flex-basis: 100%; }
}
