/* =========================================================
   CollaLex — styles-site.css
   TEMPORARY split file (transitional restructure).
   Extracted verbatim from the old styles.css.
   Will be rejoined into the final stylesheet later.
   ========================================================= */

/* -----------------------------------------------------------
   RESET (old styles.css Section 2)
   ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg-page);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* -----------------------------------------------------------
   TOP NAV / SUB NAV / LEFT NAV / PAGE WRAPPER (old Section 3)
   ----------------------------------------------------------- */
.topnav {
    background: var(--color-teal-primary); height: 52px; display: flex; align-items: center;
    padding: 0 20px; justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.topnav-left { display: flex; align-items: center; gap: 12px; }
.header-logo {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}
.header-logo-placeholder {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 0.5px;
}
.project-name { color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 0.2px; }
.topnav-right { display: flex; align-items: center; gap: 6px; }
.topnav-icon-btn {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.8); cursor: pointer;
    transition: background 0.15s; border: none; background: transparent;
}
.topnav-icon-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 13px;
    cursor: pointer; position: relative;
}
.user-dropdown {
    position: absolute; top: 44px; right: 0; background: var(--color-surface);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 180px; padding: 6px 0; display: none; z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 16px; color: var(--color-text); font-size: 14px; transition: background 0.1s;
}
.user-dropdown a:hover { background: var(--color-bg-hover); }
.user-dropdown .divider, .subnav-dropdown .divider { height: 1px; background: var(--color-border); margin: 4px 0; }

.subnav {
    background: var(--color-surface); border-bottom: 1px solid var(--color-border);
    height: 44px; display: flex; align-items: stretch; padding: 0 20px;
    position: sticky; top: 52px; z-index: 90;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.subnav-item {
    display: flex; align-items: center; gap: 6px;
    padding: 0 14px; font-size: 13.5px; font-weight: 500;
    color: var(--color-text-secondary); cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap; position: relative;
}
.subnav-item:hover { color: var(--color-navy); }
.subnav-item.active { color: var(--color-navy); border-bottom-color: var(--color-navy); font-weight: 600; }
.subnav-item .chevron { opacity: 0.5; transition: transform 0.15s; }
.subnav-item:hover .chevron { opacity: 1; }
.subnav-dropdown {
    position: absolute; top: 100%; left: 0; background: var(--color-surface);
    border-radius: 0 0 8px 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px; padding: 6px 0; display: none; z-index: 200;
    border-top: 2px solid var(--color-navy);
}
.subnav-item:hover .subnav-dropdown { display: block; }
.subnav-dropdown a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px; color: var(--color-text-secondary); font-size: 13.5px;
    font-weight: 400; transition: background 0.1s, color 0.1s;
}
.subnav-dropdown a:hover { background: var(--color-bg-divider); color: var(--color-navy); }

.page-wrapper { display: flex; min-height: calc(100vh - 96px); }

.leftnav {
    width: 220px; flex-shrink: 0; background: var(--color-surface);
    border-right: 1px solid var(--color-border); padding: 20px 0;
    position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto;
}
.leftnav-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--color-text-faint); padding: 12px 20px 6px;
}
.leftnav-title {
    padding: 0px 20px 0px 20px; margin-bottom: 0;
}
.leftnav a {
    display: block; padding: 9px 20px; font-size: 13.5px;
    color: var(--color-text-secondary); transition: background 0.1s, color 0.1s;
    border-left: 3px solid transparent;
}
.leftnav a:hover { background: var(--color-bg-divider); color: var(--color-navy); }
.leftnav a.active {
    background: var(--color-bg-active); color: var(--color-navy);
    border-left-color: var(--color-navy); font-weight: 600;
}

/* MAIN CONTENT */
.main-content { flex: 1; padding: 28px 32px; min-width: 0; }
.main-content.no-leftnav { max-width: 1100px; }


/* -----------------------------------------------------------
   COMMON UI (old Section 4)
   ----------------------------------------------------------- */
h1 { font-size: 22px; font-weight: 700; color: var(--color-navy); margin-bottom: 20px; }
h2 { font-size: 17px; font-weight: 600; color: var(--color-text); margin-bottom: 14px; }

.page-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.page-header h1 { margin-bottom: 0; }

.card {
    background: var(--color-surface); border-radius: 8px; border: 1px solid var(--color-border);
    padding: 24px; margin-bottom: 20px;
}

/* Width container — base + named modifiers replacing ad hoc inline overrides */
.page-layout { max-width: 700px; margin: 0 auto; }
.page-layout--md  { max-width: 760px; margin: 0 auto; }
.page-layout--lg  { max-width: 860px; margin: 0 auto; }
.page-layout--xl  { max-width: 960px; margin: 0 auto; }

.page-breadcrumb { font-size: 18px; font-weight: 700; color: var(--color-navy); margin-bottom: 24px; }
.page-breadcrumb span { color: var(--color-text-faint); margin: 0 6px; }
.page-breadcrumb a { color: var(--color-navy); text-decoration: none; }
.page-breadcrumb a:hover { text-decoration: underline; }

.text-muted { color: var(--color-text-muted); font-size: 13px; }
.masked-value { color: var(--color-text-faint); }

.section-header {
    display: flex; align-items: center; justify-content: space-between; margin-top: 32px;
}


/* -----------------------------------------------------------
   AVATAR / LOGO CIRCLE (old Section 5)
   ----------------------------------------------------------- */
.avatar-circle {
    --avatar-size: 40px;
    width: var(--avatar-size); height: var(--avatar-size);
    border-radius: 50%; object-fit: cover; border: 2px solid var(--color-border);
    background: var(--color-navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; flex-shrink: 0;
    font-size: calc(var(--avatar-size) * 0.4);
}
.avatar-circle--sm  { --avatar-size: 28px; }
.avatar-circle--md  { --avatar-size: 36px; }
.avatar-circle--lg  { --avatar-size: 64px; }
.avatar-circle--xl  { --avatar-size: 80px; }


/* -----------------------------------------------------------
   INFO CARD (view/edit toggle pattern) (old Section 6)
   ----------------------------------------------------------- */
.info-card { background: var(--color-surface); border-radius: 10px; border: 1px solid var(--color-border); overflow: hidden; margin-bottom: 24px; }
.info-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 3px solid var(--color-border); display: block; }
.info-avatar-placeholder { width: 56px; height: 56px; border-radius: 50%; background: var(--color-navy); border: 3px solid var(--color-border); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #fff; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th { width: 180px; padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--color-text-muted); border-bottom: 1px solid var(--color-bg-divider); vertical-align: middle; }
.info-table td { padding: 10px 16px; border-bottom: 1px solid var(--color-bg-divider); font-size: 13px; color: var(--color-text); vertical-align: middle; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }
.info-table input[type=text], .info-table input[type=email], .info-table input[type=password], .info-table textarea, .info-table select { width: 100%; padding: 5px 8px; font-size: 13px; border: 1px solid var(--color-border-strong); border-radius: 5px; background: var(--color-surface); }
.info-edit-input { display: none !important; }
.info-edit-only { display: none !important; }
.info-view-only { display: block; }
.info-card.editing .info-edit-input { display: block !important; }
.info-card.editing .info-edit-input[style*="flex-direction"] { display: flex !important; }
.info-card.editing .info-edit-only { display: flex !important; }
.info-card.editing .info-view-only { display: none !important; }
.info-actions { padding: 16px; display: flex; gap: 10px; border-top: 1px solid var(--color-bg-divider); align-items: center; }
.info-card .card-header { padding: 14px 16px; border-bottom: 1px solid var(--color-bg-divider); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--color-text-muted); }
.info-card--empty { padding: 40px; text-align: center; color: var(--color-text-muted); }
.info-card-empty-text { font-size: 13px; }


/* -----------------------------------------------------------
   MODALS (old Section 11)
   ----------------------------------------------------------- */
.modal-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 9000; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal-box {
    background: var(--color-surface); border-radius: 8px; padding: 28px; min-width: 340px;
    max-width: 420px; box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.modal-box h3, .modal-box h4 { margin: 0 0 16px; font-size: 15px; }
.modal-box p { font-size: 13px; color: var(--color-text-secondary); margin: 0 0 20px; }
.modal-box .modal-actions { display: flex; gap: 10px; justify-content: flex-end; }


/* -----------------------------------------------------------
   PROGRESS BAR (old Section 12)
   ----------------------------------------------------------- */
.progress-track { height: 6px; background: var(--color-border); border-radius: 3px; }
.progress-fill { height: 100%; background: var(--color-navy); border-radius: 3px; transition: width 0.3s; }


/* -----------------------------------------------------------
   CODE / TERMINAL PANEL (old Section 13)
   ----------------------------------------------------------- */
.code-block {
    background: var(--color-code-bg); color: var(--color-code-text);
    padding: 16px; border-radius: 6px; font-size: 12px; overflow-x: auto;
    white-space: pre; line-height: 1.6; margin: 0;
}
.code-block--result { white-space: pre-wrap; min-height: 60px; display: none; }
.snippet-tab {
    padding: 7px 14px; font-size: 12.5px; font-weight: 500; border: none; background: none;
    cursor: pointer; color: var(--color-text-muted); border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: color 0.15s;
}
.snippet-tab:hover { color: var(--color-navy); }
.snippet-tab.active { color: var(--color-navy); border-bottom-color: var(--color-navy); font-weight: 600; }
.copy-btn { position: absolute; top: 8px; right: 8px; }


/* -----------------------------------------------------------
   WORDLIST CARD (visual only) — from old Section 18
   PLACEMENT ASSUMPTION: not explicitly assigned when this split
   was requested. Filed here as a "card" component; the
   .wl-input piece from this same original section was filed in
   styles-forms.css instead (see note there). Reconsider on rejoin
   if this doesn't match how it's actually used in the views.
   ----------------------------------------------------------- */
.wordlist-card {
    background: var(--color-surface); border-radius: 8px; border: 1px solid var(--color-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 16px;
    display: flex; gap: 14px; align-items: flex-start;
}
.wordlist-card-cover {
    flex-shrink: 0; display: flex; flex-direction: column; align-items: stretch; gap: 6px;
}
.wordlist-card-cover img, .wordlist-card-cover .no-image {
    width: 70px; height: 88px; object-fit: cover; border: 1px solid var(--color-border); display: block;
}
.wordlist-card-cover .no-image {
    background: var(--color-border); display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: var(--color-text-faint); text-align: center; padding: 4px;
}

/* -----------------------------------------------------------
   INPUT GROUP (old Section 18) — generic "glued" compound input:
   a label/select on the left visually joined to an input on the
   right. Used by the wordlist response row and the profile phone
   field, which previously each inline-styled the same look
   independently.
   ----------------------------------------------------------- */
.input-group { display: flex; align-items: center; }
.input-group-addon {
    display: inline-flex; align-items: center; padding: 5px 10px;
    background: var(--color-bg-hover); border: 1px solid var(--color-border-strong); border-right: none;
    border-radius: 5px 0 0 5px; font-size: 13px; white-space: nowrap;
    color: var(--color-text-secondary); flex-shrink: 0;
}
.input-group-start {
    border-radius: 5px 0 0 5px; border-right: none;
    background: var(--color-bg-hover); padding: 5px 6px; font-size: 13px; flex-shrink: 0;
}
.input-group-end {
    border-radius: 0 5px 5px 0; padding: 5px 8px; font-size: 13px;
    flex: 1; min-width: 0;
}

/* -----------------------------------------------------------
   IMAGE UPLOAD + CROP (old Section 20)
   ----------------------------------------------------------- */
.avatar-edit-trigger {
    position: relative; display: inline-block; cursor: pointer;
    border-radius: 50%; line-height: 0;
}
.avatar-edit-overlay {
    position: absolute; inset: 0; border-radius: 50%;
    background: rgba(var(--color-navy-rgb), 0.55);
    display: flex; align-items: center; justify-content: center;
    color: #fff; opacity: 0; transition: opacity 0.15s ease;
}
.avatar-edit-trigger:hover .avatar-edit-overlay { opacity: 1; }
.avatar-edit-overlay svg, .avatar-edit-overlay i { width: 20px; height: 20px; }

.image-crop-container {
    max-height: 360px; overflow: hidden; background: var(--color-code-bg);
    border-radius: 6px; margin-top: 4px;
}
.image-crop-container img { display: block; max-width: 100%; }