/*styles*/
/*dont ask me why --> probably cause it just looked good*/
/*learning css so theres a shit ton of comments deal with it*/


@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400&family=Space+Grotesk:wght@500;700&display=swap');

/* 2. VARIABLES */
:root {
    /* Backgrounds */
    --bg-void: var(--mud-palette-background);
    /* #0F0F0F */
    --text-main: var(--mud-palette-text-primary);
    /* #E0E0E0 */
    --text-muted: var(--mud-palette-text-secondary);
    /* #A0A0A0 */
    --bg-surface: #1A1A1A;
    --bg-surface-hover: #252525;
    --primary-dim: rgba(187, 134, 252, 0.1);
    --secondary: #03DAC6;
    --error: #CF6679;

    /* Accents */
    --primary: var(--mud-palette-primary);
    /* #BB86FC */
    --border: var(--mud-palette-lines-default);
    /* #333333 (approx) */

    /* Fonts */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'JetBrains Mono', monospace;

    /*sidebar*/
    --sidebar-collapsed: 72px;
    --sidebar-expanded: 320px;
}

/*remove the fucking scrollbars*/
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-void);
    color: var(--text-main);
    font-family: var(--font-body);
}

/*remove that uggly error at the bottom */

/* --- BLAZOR ERROR UI --- */
/* This div lives in index.html. We must style it or it breaks layout. */
#blazor-error-ui {
    /* 1. LAYOUT: Float it at the bottom, don't take up space */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    /* Ensure it sits on top of everything */

    /* 2. VISIBILITY: Hidden by default (Blazor JS toggles this to 'block' on error) */
    display: none;

    /* 3. THEME: Make it look like a Critical Alert */
    background-color: var(--bg-surface);
    border-top: 1px solid var(--error);
    color: var(--error);
    padding: 10px 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

/* The "Reload" link */
#blazor-error-ui .reload {
    color: var(--text-main);
    text-decoration: underline;
    cursor: pointer;
    margin-left: 10px;
}

/* The "X" dismiss button */
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

#blazor-error-ui .dismiss:hover {
    color: var(--text-main);
}

/*idk how this works eihter but blazor needs it*/
#app {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.loading-screen {
    height: 100%;
    width: 100%;
    background-color: var(--bg-surface);
}

/*LAYOUT SHELL*/
.layout-shell {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--mud-palette-background);
    color: var(--mud-palette-text-primary);
    font-family: var(--font-body);
}


.breadcrumb {
    display: none;

    align-items: center;
    justify-content: center;
    gap: 15px;

    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;

    margin-left: 18px;
    line-height: 1;
    margin-bottom: auto;
}


.breadcrumb.visible {
    align-items: center;
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.breadcrumb-divider {
    color: var(--border);
    font-family: var(--font-code);
    font-size: 1.5rem;
    font-weight: 300;
}

.context-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--mud-palette-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.02em;
    line-height: 1;
}

.encrypted-badge {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--secondary);
    background: rgba(3, 218, 198, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.app-header {
    height: 70px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    /*transparent using var*/
    background-color: color-mix(in srgb, var(--mud-palette-background), transparent 5%);
    /*blur things behinf header*/
    backdrop-filter: blur(10px);
    /*align items to center*/
    display: flex;
    /*align-items: center;*/
    justify-content: space-between;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/*what holds the actual logo links etc*/
.header-content {
    /*font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem*/
    letter-spacing: -0.04em;
    padding: 0px 40px;
    width: 100%;
    display: flex;
    /*logo left links right*/
    justify-content: space-between;
    /*vertically centered*/
    align-items: center;
}

.nav-item {
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
    /*need this in case i add more links*/
    margin-left: 20px;
}

.nav-item:hover {
    color: var(--mud-palette-text-primary);
}


.logo-link {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;

    display: flex;
    align-items: center;
    line-height: 1;
    height: 100%;
}

.logout-link {
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
    margin-left: 20px;
}

.logout-link:hover {
    color: var(--error);
}


.logo-link {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    /*letters closer togetehr*/
    letter-spacing: -0.04em;

    color: var(--mud-palette-text-primary);
    /*remove default blue underline*/
    text-decoration: none;

    /*prep for animation*/
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.logo-link:hover {
    /*switch to primary color (purple)*/
    color: var(--mud-palette-primary);
    text-shadow: 0 0 15px rgba(187, 134, 252, 0.4);
}

.nav-links-log {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border-right: 1px solid var(--border);
    padding-right: 30px;
    margin-right: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.username {
    font-size: 1rem;
    text-decoration: none;
    color: var(--mud-palette-text-secondary);
}

.user-link:hover .username {
    color: var(--mud-palette-text-primary);
}

.avatar {
    font-weight: bold;
    width: 32px;
    height: 32px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.user-avatar {
    background-color: var(--primary);
    color: black;
}

/*
.logout {
    color: var(--mud-palette-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.2s;
    margin-left: 20px;
}

.logout:hover {
    color: var(--mud-palette-text-primary);
}*/

/*HOME PAGE*/

.landing-hero {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 12vh;
    background: radial-gradient(circle at 50% 30%, #1a1520 0%, var(--bg-void) 60%);
}

.landing-hero:hover {
    cursor: default;
}

.hero-title {
    font-family: var(--font-heading);
    color: var(--mud-palette-text-primary);
    outline: none;
    font-size: 4rem;
    text-align: center;
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero-title:focus {
    outline: none;
    border: none;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-family: var(--font-body);
    color: var(--mud-palette-text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 600px;
    text-align: center;
}

.hero-buttons {
    display: flex;
    flex-direction: row;
    gap: 16px;
}

.btn-outline,
.btn-primary {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;

    padding: 6px 20px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;

    display: inline-flex;
    justify-content: center;
    align-items: center;

    /*smooth hover they said*/
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--mud-palette-primary);
    /*pure black for best conttrast*/
    color: #000000;
    /* Prevents size jump when swapping borders */
    border: 1px solid var(--primary);
}

.btn-outline {
    background-color: transparent;
    color: var(--mud-palette-text-primary);
    border: 1px solid var(--border);
    font-weight: 400;
}

.btn-primary:hover,
.btn-outline:hover {
    /*move up a little bit*/
    transform: translateY(-2px);
}

.btn-primary:hover {
    /*glowwww*/
    text-shadow: 0 0 15px rgba(187, 134, 252, 0.4);
}

.btn-primary:active,
.btn-outline:active {
    /*push back down when active*/
    transform: translateY(0px);
}


/*LOGIN*/

.auth-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    padding-bottom: 4vh;
}

.auth-card {
    width: 400px;
    background: var(--bg-surface);
    padding: 30px 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.auth-h1 {
    cursor: default;
    font-family: var(--font-heading);
    margin-bottom: 10px;
    font-weight: 900;
    font-size: 1.5rem;
}

.auth-p {
    cursor: default;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-link {
    text-align: center;
    margin-bottom: 0px;
    padding-bottom: 0px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 10px;
    cursor: pointer;
    transition: color 0.2s;
}

.new-identity:hover {
    color: var(--text-main);
}

.form-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: block;
    letter-spacing: 0.05em;
}

.input-std {
    background-color: var(--mud-palette-background);
    color: var(--text-main);
    width: 100%;
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 6px;
    outline: none;
    font-size: 0.8rem;
    transition: border 0.2s;
}

.input-std::placeholder {
    letter-spacing: 0.1em;
}

.auth-form .input-std:hover:not(:focus) {
    border-color: var(--text-muted);
}

.input-std:focus {
    border-color: var(--primary);
}

input[type="password"] {
    letter-spacing: 0.25em;
    font-family: var(--font-body);
}

/* home */

.auth-card.vault {
    width: 600px;
    /*background: var(--primary);*/
}

.auth-card.vault .input-std {
    width: 100%;
    border: 1px solid var(--border);
    padding: 16px 16px 16px 16px;
    font-size: 1rem;
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-body);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    outline: none;
}

.auth-card.vault .input-std:hover {
    border-color: var(--text-muted);
}

.auth-card.vault .input-std:focus {
    border-color: var(--primary);
}

.auth-card.vault .form-label {
    font-size: 1rem;
}

.auth-card.vault.auth-h1 {
    font-size: 1.8rem;
}


/*SIDEBAR*/


.app-layout {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    width: 100%;
}

.main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
    height: 100%;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
    z-index: 50;
    position: relative;

    --dot-size: 8px;
    --dot-color: var(--secondary);
}

.sidebar:hover {
    width: var(--sidebar-expanded);
}


.sidebar-top {
    position: relative;
    height: 70px;
    flex-shrink: 0;
}

.collapsed-icon {
    position: absolute;
    width: var(--sidebar-collapsed);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-code);
    font-size: 1.5rem;
    color: var(--text-muted);
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar:hover .collapsed-icon {
    opacity: 0;
    pointer-events: none;
}

.expanded-search {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 15px;
    display: flex;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar:hover .expanded-search {
    opacity: 1;
    pointer-events: auto;
    transition-delay: 0.2s;
}


.side-nav-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 10px;
    gap: 5px;
}

.sidebar:hover .side-nav-list {
    opacity: 1;
    transition-delay: 0.2s;
}

.side-nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    height: 50px;
    cursor: pointer;
    position: relative;
    padding: 12px 4px;
    border-radius: 8px;
}

.side-nav-item:hover {
    background: var(--bg-surface-hover);
    cursor: pointer;
}

.side-nav-item.sidebar-locked {
    cursor: default;
    opacity: 0.5;
}

.side-nav-item.sidebar-locked:hover {
    background: transparent;
    cursor: default; 
}

.side-avatar {
    background-color: var(--bg-surface-hover);
    color: var(--mud-palette-text-primary);
}

.selected-conversation {
    background-color: var(--primary-dim);
}

.selected-conversation .side-avatar {
    background-color: var(--primary-dim);
    color: var(--primary);
    border-color: var(--primary);
}

.nav-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface-hover);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.side-nav-info {
    padding-left: 10px;
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-size: 0.9rem;
    font-family: var(--font-heading);
    color: var(--text-main);
}

.chat-preview {
    font-size: 0.75rem;
    font-family: var(--font-body);
    color: var(--text-muted);
}

.sidebar-bottom {
    cursor: default;
    margin-top: auto;
    margin-bottom: 16px;
    height: 50px;
    display: flex;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
}

.status-dot-wrapper {
    width: var(--sidebar-collapsed);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-dot {
    width: var(--dot-size);
    height: var(--dot-size);
    background-color: var(--dot-color);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--dot-color);
}

.status-text {
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar:hover .status-text {
    opacity: 1;
    transition-delay: 0.2s;
}

.dashboard-view {
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-bottom: 50px;
}

/*.dashboard-view {
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    padding-top: 25vh; 
    overflow-y: auto; 
    height: 100%;
    padding-bottom: 50px; 
}*/

.dash-greeting {
    font-family: var(--font-heading);
    margin-bottom: 10px;
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 30px;
}

.dash-search-wrapper {
    position: relative;
    width: 500px;
}

.search-results-popup {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;

    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 10px;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.search-item {
    padding: 12px 20px;
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-main);
    border: 1px solid var(--primary);
}

.search-item:first-child:hover {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.search-item:last-child:hover {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.search-item.existing-friend {
    color: var(--primary);
}

.search-item.existing-friend:hover {
    color: var(--text-main);
    background-color: var(--primary-dim);
}

.dash-search {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 20px 16px 16px 56px;
    font-size: 1.1rem;
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-body);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    outline: none;
}

.dash-search:focus {
    border-color: var(--primary);
}

.dash-icon {
    /*need to slap it on top of textbox -> position absolute*/
    position: absolute;
    left: 20px;
    top: 16px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.dash-shortcuts {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.shortcut-chip {
    font-size: 0.8rem;
    font-family: var(--font-code);
    color: var(--mud-palette-text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    border-radius: 5px;
    padding: 5px 10px;
    background-color: var(--bg-surface);
}

.shortcut-chip:hover {
    color: var(--primary);
    border-color: var(--primary);
}



/* CHAT */

.chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.msg-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 60%;
    margin-top: 2px;
}

.msg-header-row {
    display: flex;
    font-family: var(--font-code);
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    margin-left: 4px;
    flex-direction: row;
}

.msg-sender {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-body);
    opacity: 0.9;
}

.sent .msg-header-row {
    flex-direction: row-reverse;
    margin-right: 4px;
}

.msg-time-header {
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.6;
    font-weight: 500;
}

.msg-wrapper:is(.consecutive) .msg-header-row {
    display: none;
}

.msg-wrapper:not(.consecutive) {
    margin-top: 20px;
}

.msg-wrapper.received {
    align-self: flex-start;
    align-items: flex-start;
}

.msg-wrapper.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.bubble {
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.received .bubble {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.sent .bubble {
    background-color: var(--primary);
    color: #0F0F0F;
    font-weight: 500;
    border-bottom-right-radius: 2px;
}

.input-area {
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    background: var(--bg-void);
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.msg-input {
    height: 40px;
}

.send-btn {
    width: 50px;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 1.6rem;
    cursor: pointer;
    font-weight: bold;
    font-family: var(--font-code);
    transition: all 0.2s;
}

.send-btn:hover {
    border-color: var(--primary);
}

.error {
    color: var(--error);
    font-family: var(--font-body);
    font-size: 1rem;
}

.inbox-empty-area {
    flex: 1;
    display: flex;
    align-items: center;      /* vertical center */
    justify-content: center;  /* horizontal center */
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-body);
    opacity: 0.7;
}

.inbox-empty-text {
    font-size: 1.05rem;
}


/* PASSPHRASE */

.auth-card {
    /* add transition */
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.auth-card.wide {
    /*double the width*/
    width: 850px;
}

/*grid container for form*/
.form-content-grid {
    display: grid;
    /* default single column */
    grid-template-columns: 1fr;
    gap: 0;
    transition: all 0.4s ease;
}

/* when wide -> two columns*/
.auth-card.wide .form-content-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 20px;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* animation for pasphrase column*/
.passphrase-col {
    opacity: 0;
    /* slide in animation */
    animation: fadeIn 0.5s ease 0.1s forwards;
    /* separator line...? wtf is even that */
    border-left: 1px solid var(--border);
    padding-left: 40px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/*sidebar unread*/
.unread .chat-name {
    color: var(--mud-palette-primary);
    font-weight: bold;
}


/* TERMINAL OUTPUT CARD */
/* TODO: read what gemini cooked here */

.terminal-output-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    width: 500px;
    /*box-shadow: 0 0 20px rgba(3, 218, 198, 0.1);*/
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-family: var(--font-code);
    color: var(--secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}


.btn-copy-all {
    background: rgba(3, 218, 198, 0.1);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    font-family: var(--font-code);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy-all:hover {
    background: var(--secondary);
    color: #000;
    box-shadow: 0 0 10px rgba(3, 218, 198, 0.3);
}

.invite-code-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border);
    color: var(--text-main);
    font-family: var(--font-code);
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    user-select: text;
    cursor: default;
}


.invite-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 5px;
}


.invite-code-chip:hover {
    background: rgba(3, 218, 198, 0.1);
    border-color: var(--secondary);
    color: var(--secondary);
}

/* "COPY" hint that appears on hover */
.copy-hint {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.invite-code-chip:hover .copy-hint {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font-code);
    font-size: 1.1rem;
}

.btn-icon:hover {
    color: var(--error);
}


.dash-search {
    transition: all 0.2s ease;
}

.dash-search.mention-mode {
    border-color: var(--primary);
    color: var(--primary);
    background-color: 0 0 15px rgba(187, 134, 252, 0.0.4);
    box-shadow: 0 0 15px rgba(187, 134, 252, 0.4);
}


.dash-search-wrapper:has(.mention-mode) .dash-icon {
    color: var(--primary);
    text-shadow: 0 0 5px var(--primary);
}


/* COMMAND MODE STYLES */
.dash-search.command-mode {
    border-color: var(--secondary);
    color: var(--secondary);
    background-color: rgba(3, 218, 198, 0.05); 
    box-shadow: 0 0 15px rgba(3, 218, 198, 0.2);
}

.dash-search-wrapper:has(.command-mode) .dash-icon {
    color: var(--secondary);
    text-shadow: 0 0 5px var(--secondary);
}


.lock-icon {
    color: var(--text-main);
    font-size: 1rem;
    opacity: 0.9;
    text-shadow: 0 0 15px var(--primary-dim);
}

.auth-card.vault:has(.lock-icon:hover) .input-std {
    border-color: var(--primary);
}


/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE / TABLET)
   ========================================================================== */

@media screen and (max-width: 768px) {
    /* 1. Variables & Layout Foundation */
    :root {
        /* Slightly thinner rail on mobile to save screen real estate */
        --sidebar-collapsed: 60px;
        --sidebar-expanded: 260px; 
    }

    /* 2. Header Adjustments */
    .header-content {
        padding: 0 16px;
    }
    .logo-link {
        font-size: 1.3rem;
    }
    .breadcrumb {
        display: none !important; /* Hide to prevent header text overlap */
    }
    .user-link {
        padding-right: 15px;
        margin-right: 5px;
        border-right: none; 
    }
    .user-link .username {
        display: none; /* Switch to icon-only profile */
    }
    .logout-link {
        margin-left: 0;
        font-size: 0.8rem;
    }

    /* 3. Landing & Auth Screens */
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 20px;
    }
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        gap: 12px;
    }
    
    /* Override hardcoded desktop widths */
    .auth-card,
    .auth-card.vault,
    .auth-card.wide {
        width: 90% !important;
        max-width: 400px;
        padding: 24px 20px;
    }
    
    /* Collapse the 2-column grid into a single stack for the register page */
    .auth-card.wide .form-content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .passphrase-col {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 20px;
        animation: fadeIn 0.5s ease forwards; /* Maintain your animation */
    }

    /* 4. Dashboard (Home View) */
    .dash-greeting {
        font-size: 1.6rem;
        text-align: center;
        padding: 0 10px;
    }
    .dash-search-wrapper,
    .terminal-output-card {
        width: 90%;
        max-width: 100%;
    }
    .dash-search {
        padding: 16px 16px 16px 48px;
        font-size: 1rem;
    }
    .dash-icon {
        left: 16px;
    }
    .invite-grid {
        grid-template-columns: 1fr; /* Single column for invite codes */
    }

    /* 5. Sidebar Navigation (The Mobile Overlay Pattern) */
    .app-layout {
        position: relative; 
    }
    .sidebar {
        /* Take it out of the flex flow so it doesn't crush the chat when expanded */
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100%;
        z-index: 100;
    }
    .sidebar:hover {
        /* Add a drop shadow so it pops off the chat background when expanded */
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.6);
    }
    .main-stage {
        /* Offset the chat area so the collapsed 60px rail doesn't hide text */
        margin-left: var(--sidebar-collapsed);
        width: calc(100% - var(--sidebar-collapsed));
    }

    /* 6. Chat Interface */
    .messages-area {
        padding: 16px;
    }
    .msg-wrapper {
        max-width: 90%; /* Let the text bubbles utilize more width */
    }
    .input-area {
        padding: 12px 16px;
        gap: 8px;
    }
    .send-btn {
        width: 45px;
        font-size: 1.3rem;
    }
}