/* ============================================================
   Uniswap Monitor — Global Styles
   Dark theme with Uniswap pink accent
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ---- CSS Variables ---- */
:root {
    --bg: #0d0e12;
    --surface: #16181f;
    --surface2: #1e2029;
    --border: #2a2d3a;
    --pink: #ff007a;
    --pink-hover: #d4006a;
    --pink-glow: rgba(255, 0, 122, 0.18);
    --green: #1db954;
    --orange: #ff8c00;
    --red: #e63946;
    --text: #e8eaf0;
    --text-muted: #7a7f96;
    --text-dim: #4a4f6a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --font: 'Inter', sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --transition: 0.2s ease;
    --nav-h: 64px;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--pink);
    text-decoration: none;
    transition: opacity var(--transition);
}

a:hover {
    opacity: 0.8;
}

input,
select,
button {
    font-family: var(--font);
}

/* ============================================================
   AUTH PAGES (login, register)
   ============================================================ */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 0, 122, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(100, 50, 255, 0.07) 0%, transparent 60%),
        var(--bg);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow), 0 0 60px rgba(255, 0, 122, 0.06);
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-icon {
    font-size: 36px;
    background: var(--pink-glow);
    border: 1px solid var(--pink);
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 0 20px var(--pink-glow);
    animation: pulse 3s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 20px var(--pink-glow);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 0, 122, 0.35);
    }
}

.brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.brand p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================================
   FORM ELEMENTS (shared)
   ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.4px;
}

.form-group input,
.form-group select {
    background: var(--surface2);
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7f96' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-group select option {
    background: var(--surface2);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px var(--pink-glow);
}

.form-group input::placeholder {
    color: var(--text-dim);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--pink);
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 0, 122, 0.3);
}

.btn-primary:hover {
    background: var(--pink-hover);
    box-shadow: 0 4px 20px rgba(255, 0, 122, 0.45);
}

.btn-full {
    width: 100%;
    padding: 13px;
    font-size: 15px;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
}

.btn-ghost:hover {
    background: var(--surface2);
    color: var(--text);
}

.btn-danger {
    background: rgba(230, 57, 70, 0.12);
    color: var(--red);
    border: 1.5px solid rgba(230, 57, 70, 0.3);
}

.btn-danger:hover {
    background: rgba(230, 57, 70, 0.2);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    animation: fadeUp 0.3s ease;
}

.alert-success {
    background: rgba(29, 185, 84, 0.1);
    border-color: rgba(29, 185, 84, 0.35);
    color: #1db954;
}

.alert-error {
    background: rgba(230, 57, 70, 0.1);
    border-color: rgba(230, 57, 70, 0.35);
    color: var(--red);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    height: var(--nav-h);
    background: rgba(22, 24, 31, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(90deg, #ff007a, #b44be1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Navbar tab links ---- */
.navbar-links {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--surface);
    color: var(--text);
    opacity: 1;
}

.nav-link.active {
    background: var(--pink);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(255, 0, 122, 0.3);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-pill {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 700px) {
    .navbar-links {
        display: none;
    }
}

/* ============================================================
   DASHBOARD PAGE
   ============================================================ */
.dashboard-page .dashboard-content {
    width: 100%;
    margin: 16px auto;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---- Card ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: fadeUp 0.4s ease;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 24px 28px 0;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.card-header p {
    width: 100%;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Position Form ---- */
.position-form {
    padding: 0 28px 28px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ---- Badge ---- */
.badge {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.version-tag {
    display: inline-block;
    background: var(--pink-glow);
    color: var(--pink);
    border: 1px solid rgba(255, 0, 122, 0.25);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ---- Status Badge ---- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-in {
    background: rgba(29, 185, 84, 0.12);
    border-color: rgba(29, 185, 84, 0.3);
    color: #1db954;
}

.badge-out {
    background: rgba(255, 140, 0, 0.12);
    border-color: rgba(255, 140, 0, 0.3);
    color: var(--orange);
}

.badge-closed {
    background: rgba(230, 57, 70, 0.12);
    border-color: rgba(230, 57, 70, 0.3);
    color: var(--red);
}

.badge-unknown {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text-dim);
}

.badge-notified {
    background: rgba(255, 140, 0, 0.12);
    border-color: rgba(255, 140, 0, 0.3);
    color: var(--orange);
}

.badge-not-notified {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text-dim);
}

/* ---- Table ---- */
.table-wrap {
    overflow-x: auto;
    padding: 0 0 4px;
}

.positions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.positions-table thead tr {
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
}

.positions-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.positions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(42, 45, 58, 0.5);
    vertical-align: middle;
    font-size: 13px;
}

.positions-table tbody tr:last-child td {
    border-bottom: none;
}

.positions-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.positions-table code {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--surface2);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--text-muted);
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}