/* Shared styles for the ImmunoVerse-Chat login portal.
 *
 * Tailwind CDN handles the bulk of utilities; this file holds the
 * brand-specific additions:
 *   - dark navy molecular background for the left brand panel
 *   - the signature violet -> teal gradient (matches the live
 *     immunoverse-chat.com landing premium-gradient)
 *   - tabs, animations, admin layout, chat bubbles
 *
 * Palette mirrors web/index.html on the live site:
 *   primary   #6E36F0  (violet)
 *   secondary #006874  (teal)
 *   accent    #22B8CF  (gradient end + highlights)
 *   bg        #F8F9FA
 *   text      #0B0F1A
 */

:root {
    --color-primary: #6E36F0;
    --color-primary-hover: #5C25DE;
    --color-secondary: #006874;
    --color-accent: #22B8CF;
    --color-on-surface: #0B0F1A;
    --color-on-surface-variant: #494456;
    --color-outline: #cbc3d8;
    --color-outline-variant: #E2E8F0;
    --color-success: #10B981;
    --color-error: #ba1a1a;
    --color-surface: #ffffff;
    --color-surface-container-low: #F1F4F6;
    --color-surface-container: #f3edf7;
    --color-surface-container-high: #e7e0ef;
    --color-background: #F8F9FA;

    /* Dark navy for the left brand panel — taken from live site's deep-neutral text colour */
    --color-brand-dark: #0B0F1A;
}

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--color-on-surface);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---------- Signature violet -> teal gradient ---------- */
.premium-gradient {
    background: linear-gradient(45deg, #6E36F0, #22B8CF);
}
.premium-gradient-text {
    background: linear-gradient(45deg, #6E36F0, #22B8CF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.premium-gradient-border {
    position: relative;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(45deg, #6E36F0, #22B8CF) border-box;
    border: 1px solid transparent;
}

/* ---------- Dark left brand panel ---------- */

.brand-panel {
    background-color: var(--color-brand-dark);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.brand-panel .molecular-bg {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.10) 1.5px, transparent 1.5px);
    background-size: 40px 40px;
    opacity: 0.30;
    pointer-events: none;
}
.brand-panel .hero-glow {
    position: absolute;
    top: 25%;
    left: 25%;
    width: 24rem;
    height: 24rem;
    background: radial-gradient(circle at center, rgba(110, 54, 240, 0.22) 0%, transparent 70%);
    filter: blur(48px);
    pointer-events: none;
}
.brand-panel .teal-fade {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 70%;
    height: 60%;
    background: radial-gradient(circle at bottom right, rgba(34, 184, 207, 0.18) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
}

/* ---------- Right-side soft mesh background ---------- */
.mesh-gradient {
    background-color: #ffffff;
    background-image:
        radial-gradient(at 0% 0%, hsla(265, 90%, 95%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(190, 90%, 95%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(265, 90%, 98%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(190, 90%, 98%, 1) 0, transparent 50%);
}

/* ---------- Tabs ---------- */
.tab-btn {
    background: transparent;
    border: none;
    padding-bottom: 1rem;
    flex: 1;
    color: var(--color-on-surface-variant);
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color .2s, border-color .2s;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tab-btn:hover { color: var(--color-primary); }
.tab-btn.active-tab {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn-primary {
    width: 100%;
    background: linear-gradient(45deg, #6E36F0, #22B8CF);
    color: #fff;
    padding: 0.95rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(110, 54, 240, 0.28);
    transition: transform .2s, filter .2s, box-shadow .2s;
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: -.005em;
}
.btn-primary:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px -8px rgba(110, 54, 240, 0.40);
}
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity:.55; cursor:not-allowed; box-shadow:none; }

.btn-secondary {
    width: 100%;
    background: transparent;
    color: var(--color-on-surface);
    padding: 0.825rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--color-outline-variant);
    cursor: pointer;
    transition: background-color .2s, transform .2s, border-color .2s;
    font-family: 'Inter', system-ui, sans-serif;
}
.btn-secondary:hover {
    background-color: var(--color-surface-container-low);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.btn-secondary:active { transform: scale(.98); }

/* ---------- Form inputs ---------- */
.field-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-on-surface-variant);
    margin-bottom: 0.5rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.field-input,
.field-textarea,
.field-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--color-outline-variant);
    border-radius: 10px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    color: var(--color-on-surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field-input::placeholder,
.field-textarea::placeholder { color: #94a3b8; }
.field-input:focus,
.field-textarea:focus,
.field-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(110, 54, 240, 0.10);
}
.field-textarea { min-height: 120px; resize: vertical; }

/* Badges */
.badge-success {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: .25rem .75rem;
    background-color: rgba(16, 185, 129, .10);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, .30);
    border-radius: 9999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-warning {
    display: inline-flex; align-items: center; gap: .375rem;
    padding: .25rem .75rem;
    background-color: rgba(245, 158, 11, .10);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, .30);
    border-radius: 9999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.info-card {
    display: flex; gap: .75rem;
    padding: 1rem;
    background-color: #f5f0ff;
    border: 1px solid #e8dcff;
    border-radius: 12px;
    color: #4c1d95;
}
.alert-error {
    padding: .875rem 1rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
    font-size: 14px;
}
.alert-success {
    padding: .875rem 1rem;
    background-color: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    color: #065f46;
    font-size: 14px;
}

/* Entry animation */
@keyframes slide-in-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.card-enter { animation: slide-in-up .6s ease-out both; }

/* ---------- Admin layout ---------- */
.admin-shell {
    display: flex;
    min-height: 100vh;
    background-color: var(--color-background);
}
.admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    background-color: #ffffff;
    border-right: 1px solid var(--color-outline-variant);
    display: flex;
    flex-direction: column;
}
.admin-main {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
}
.sidebar-tab {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
    padding: .625rem .875rem;
    border-radius: 8px;
    color: var(--color-on-surface-variant);
    cursor: pointer;
    font-size: 14px; font-weight: 500;
    transition: background-color .15s, color .15s;
    border: none; background: transparent;
    width: 100%; text-align: left;
    font-family: 'Inter', system-ui, sans-serif;
}
.sidebar-tab:hover { background-color: var(--color-surface-container-low); color: var(--color-on-surface); }
.sidebar-tab.active {
    background: linear-gradient(45deg, rgba(110,54,240,.10), rgba(34,184,207,.10));
    color: var(--color-primary);
    font-weight: 600;
}
.sidebar-count {
    background: linear-gradient(45deg, #6E36F0, #22B8CF);
    color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 9999px;
}
.user-list-row {
    display: flex; align-items: center; gap: .625rem;
    padding: .5rem .875rem;
    cursor: pointer;
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-on-surface-variant);
}
.user-list-row:hover { background-color: var(--color-surface-container-low); color: var(--color-on-surface); }
.user-list-row.active {
    background: linear-gradient(45deg, rgba(110,54,240,.10), rgba(34,184,207,.10));
    color: var(--color-primary);
    font-weight: 600;
}
.user-avatar {
    width: 30px; height: 30px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #6E36F0, #22B8CF);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border: 1px solid var(--color-outline-variant);
    border-radius: 12px;
    overflow: hidden;
}
.data-table th {
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; font-weight: 700;
    color: var(--color-on-surface-variant);
    text-transform: uppercase; letter-spacing: .04em;
    padding: .875rem 1rem;
    background-color: var(--color-surface-container-low);
    border-bottom: 1px solid var(--color-outline-variant);
}
.data-table td {
    padding: 1rem;
    font-size: 14px; color: var(--color-on-surface);
    border-bottom: 1px solid var(--color-outline-variant);
    vertical-align: top;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background-color: var(--color-surface-container-low); }

.status-pill {
    display: inline-block;
    padding: 2px 10px;
    font-size: 11px; font-weight: 700;
    border-radius: 9999px;
    text-transform: uppercase; letter-spacing: .04em;
    font-family: 'JetBrains Mono', monospace;
}
.status-pill.active        { background:#d1fae5; color:#065f46; }
.status-pill.pending       { background:#fef3c7; color:#92400e; }
.status-pill.suspended     { background:#fee2e2; color:#991b1b; }
.status-pill.rejected      { background:#e5e7eb; color:#374151; }
.status-pill.institutional { background:#ede9fe; color:#5b21b6; }
.status-pill.individual    { background:#cffafe; color:#155e75; }

.btn-mini {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    margin-right: 4px;
    font-family: 'Inter', system-ui, sans-serif;
}
.btn-mini.approve { background: linear-gradient(45deg, #6E36F0, #22B8CF); color:#fff; }
.btn-mini.approve:hover { filter:brightness(1.08); }
.btn-mini.reject  { background:#ef4444; color:#fff; }
.btn-mini.reject:hover { filter:brightness(1.08); }
.btn-mini.suspend { background:transparent; color:#991b1b; border-color:#fecaca; }
.btn-mini.suspend:hover { background:#fef2f2; }
.btn-mini.reinstate { background:transparent; color:#065f46; border-color:#a7f3d0; }
.btn-mini.reinstate:hover { background:#ecfdf5; }

/* Chat viewer */
.chat-session {
    background: #fff;
    border: 1px solid var(--color-outline-variant);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.chat-session-header {
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    background-color: var(--color-surface-container-low);
    border-bottom: 1px solid var(--color-outline-variant);
}
.chat-session-body { padding: 1.25rem; max-height: 480px; overflow-y: auto; }
.chat-msg { margin-bottom: .75rem; display: flex; flex-direction: column; }
.chat-msg.user { align-items: flex-end; }
.chat-msg.assistant { align-items: flex-start; }
.chat-bubble {
    max-width: 80%;
    padding: .625rem .875rem;
    border-radius: 12px;
    font-size: 14px; line-height: 1.5;
    white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user .chat-bubble {
    background: linear-gradient(45deg, #6E36F0, #22B8CF);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.assistant .chat-bubble {
    background-color: var(--color-surface-container-high);
    color: var(--color-on-surface);
    border-bottom-left-radius: 4px;
}
.chat-msg.tool .chat-bubble {
    background-color: var(--color-surface-container-low);
    color: var(--color-on-surface-variant);
    border: 1px solid var(--color-outline-variant);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px; max-width: 100%;
}
.chat-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--color-on-surface-variant);
    margin-top: 4px;
}

.hidden { display: none !important; }
