/* =========================================================================
   Response Roleplay — components.css
   Buttons, cards, forms, tables, navigation, footer, status pills.
   ========================================================================= */

/* =========================================================================
   BUTTONS
   ========================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--rrp-font-display);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 15px;
    line-height: 1;
    padding: 12px 22px;
    border-radius: var(--rrp-r);
    border: none;
    cursor: pointer;
    transition: filter 120ms ease, transform 120ms ease, background 120ms ease;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:hover    { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active   { transform: translateY(0); filter: brightness(0.95); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }

.btn .icon { width: 16px; height: 16px; flex: 0 0 16px; }

.btn-primary {
    background: var(--rrp-accent);
    color: #fff;
}

.btn-secondary {
    background: var(--rrp-glass-soft);
    color: var(--rrp-text-body);
    box-shadow: inset 0 0 0 1px var(--rrp-border);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }

.btn-discord {
    background: var(--rrp-discord);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--rrp-text-body);
    box-shadow: inset 0 0 0 1px var(--rrp-border);
}
.btn-ghost:hover {
    color: var(--rrp-text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 17px; }

.btn-block { width: 100%; }

/* =========================================================================
   CARDS
   ========================================================================= */

.card {
    background: var(--rrp-glass);
    border-radius: var(--rrp-r-lg);
    padding: 22px 26px;
    box-shadow:
        inset 3px 0 0 0 var(--rrp-accent),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.04),
        var(--rrp-shadow-card);
    position: relative;
}

/* Card without the red left accent — used for stat tiles, compact items */
.card-plain {
    background: var(--rrp-glass);
    border-radius: var(--rrp-r-lg);
    padding: 22px 26px;
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.04),
        inset 0 0 0 1px var(--rrp-border-soft),
        var(--rrp-shadow-lift);
}

/* Card with a coloured top gradient — used for command-staff and tiered items */
.card-tiered {
    background: var(--rrp-glass);
    border-radius: var(--rrp-r-lg);
    padding: 22px 26px;
    position: relative;
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.04),
        inset 0 0 0 1px var(--rrp-border-soft),
        var(--rrp-shadow-lift);
    overflow: hidden;
}
.card-tiered::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: var(--card-tier-color, var(--rrp-accent));
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.card-header h3 { letter-spacing: 1.5px; }

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--rrp-border-soft);
}

/* =========================================================================
   STATUS PILLS
   ========================================================================= */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--rrp-font-display);
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--rrp-glass-soft);
    color: var(--rrp-text-dim);
    box-shadow: inset 0 0 0 1px var(--rrp-border);
    /* Stops flex column parents (e.g. .app-card-body) from stretching */
    /* the pill to full container width. inline-flex isn't enough.     */
    align-self: flex-start;
    /* Reset native <button> chrome so pills render identically whether */
    /* they're on a <span> or a <button>.                               */
    border: 0;
    appearance: none;
    -webkit-appearance: none;
}
.pill::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill-open      { color: var(--rrp-green); }
.pill-paused    { color: var(--rrp-orange); }
.pill-closed    { color: var(--rrp-accent); }
.pill-info      { color: var(--rrp-blue); }
.pill-invite    { color: var(--rrp-purple); }

.pill-solid {
    background: var(--rrp-accent);
    color: #fff;
    box-shadow: none;
}
.pill-solid::before { display: none; }

/* =========================================================================
   FORM CONTROLS
   ========================================================================= */

.field {
    display: block;
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-family: var(--rrp-font-display);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--rrp-text-dim);
    font-size: 13px;
    margin-bottom: 8px;
}

.input, .field input, .field select, .field textarea {
    width: 100%;
    background: var(--rrp-glass-soft);
    border: 1px solid var(--rrp-border);
    border-radius: var(--rrp-r);
    padding: 11px 14px;
    color: var(--rrp-text);
    font-family: var(--rrp-font-body);
    font-size: 15px;
    transition: border-color 120ms ease, background 120ms ease;
}
.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--rrp-accent);
    background: rgba(255, 255, 255, 0.06);
}

.field textarea { resize: vertical; min-height: 100px; }

.field-hint {
    font-size: 13px;
    color: var(--rrp-text-dim);
    margin-top: 6px;
}

.field-error {
    font-size: 13px;
    color: var(--rrp-accent);
    margin-top: 6px;
}

/* =========================================================================
   TABLES
   ========================================================================= */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--rrp-r-lg);
    background: var(--rrp-glass);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.04),
        inset 0 0 0 1px var(--rrp-border-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-family: var(--rrp-font-display);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--rrp-text-dim);
    text-align: left;
    padding: 14px 16px;
    font-weight: 400;
    font-size: 13px;
    border-bottom: 1px solid var(--rrp-border);
    background: rgba(255, 255, 255, 0.02);
}

td {
    font-family: var(--rrp-font-body);
    padding: 14px 16px;
    border-bottom: 1px solid var(--rrp-border-soft);
    color: var(--rrp-text-body);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

td .mono { color: var(--rrp-text); }

/* =========================================================================
   PAGE HEADER (hero on internal pages)
   ========================================================================= */

.page-header {
    position: relative;
    padding: 64px 0 56px;
    background: var(--rrp-bg-elev);
    border-bottom: 1px solid var(--rrp-border-soft);
}
.page-header .eyebrow { margin-bottom: 10px; }
.page-header h1 { margin-bottom: 12px; }
.page-header .lede { font-size: 18px; }

.page-header .accent-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

@media (max-width: 768px) {
    .page-header { padding: 48px 0 40px; }
}

/* =========================================================================
   TOP NAVIGATION
   ========================================================================= */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 11, 20, 0.85);
    border-bottom: 1px solid var(--rrp-border-soft);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 24px;
    /* Override .container's 1200px — nav stretches wider to fit the menu */
    max-width: var(--rrp-nav-width);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--rrp-font-display);
    font-size: 22px;
    letter-spacing: 2px;
    color: var(--rrp-text);
    text-transform: uppercase;
    text-decoration: none;
    flex: 0 0 auto;
}
.nav-brand:hover { color: var(--rrp-text); }
.nav-brand .brand-mark {
    /* Tight-cropped shield at natural 1.42:1 aspect ratio.            */
    /* Explicit width AND height (no auto) + object-fit: contain makes */
    /* aspect preservation bulletproof regardless of source dims.      */
    width: 56px;
    height: 40px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}
.nav-brand .brand-accent { color: var(--rrp-accent); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    justify-content: center;
}

.nav-menu a {
    font-family: var(--rrp-font-display);
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--rrp-text-dim);
    padding: 8px 14px;
    border-radius: var(--rrp-r-sm);
    transition: color 120ms ease, background 120ms ease;
}
.nav-menu a:hover,
.nav-menu a.is-active {
    color: var(--rrp-text);
    background: rgba(255, 255, 255, 0.04);
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Logged-in user chip in the nav */
.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: var(--rrp-glass-soft);
    box-shadow: inset 0 0 0 1px var(--rrp-border);
    color: var(--rrp-text-body);
    font-family: var(--rrp-font-display);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 120ms ease, box-shadow 120ms ease;
    max-width: 200px;
}
.nav-user:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--rrp-text);
}
.nav-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex: 0 0 28px;
    box-shadow: inset 0 0 0 1px var(--rrp-border);
}
.nav-user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
.nav-logout {
    padding: 8px 10px;                              /* icon-only — square */
}

@media (max-width: 540px) {
    .nav-user-name { display: none; }               /* avatar-only on phones */
    .nav-user      { padding: 4px; }
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    color: var(--rrp-text);
    padding: 8px;
    border-radius: var(--rrp-r-sm);
}
.nav-toggle:hover { background: rgba(255, 255, 255, 0.06); }

@media (max-width: 980px) {
    .nav-menu {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--rrp-bg-elev);
        border-bottom: 1px solid var(--rrp-border);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 0;
        display: none;
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu a {
        padding: 14px var(--rrp-gutter);
        border-radius: 0;
    }
    .nav-toggle { display: inline-flex; }
}

@media (max-width: 540px) {
    .nav-cta .btn-secondary { display: none; }  /* hide Login on small screens, keep Connect */
}

/* =========================================================================
   FOOTER
   ========================================================================= */

.footer {
    background: var(--rrp-bg-elev);
    border-top: 1px solid var(--rrp-border-soft);
    padding: 56px 0 32px;
    margin-top: 64px;
    position: relative;
}
.footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: var(--rrp-gradient);
    opacity: 0.5;
}

.footer-cols {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-brand .footer-logo {
    width: 120px;
    height: auto;
    margin-bottom: 4px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}
.footer-brand .tagline {
    color: var(--rrp-text-dim);
    font-size: 14px;
    max-width: 28ch;
    line-height: 1.5;
}
.footer-brand .socials {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.footer-brand .socials a {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rrp-r-sm);
    background: var(--rrp-glass-soft);
    color: var(--rrp-text-dim);
    box-shadow: inset 0 0 0 1px var(--rrp-border);
}
.footer-brand .socials a:hover {
    color: var(--rrp-accent);
    box-shadow: inset 0 0 0 1px var(--rrp-accent);
}

.footer-col h5 {
    font-family: var(--rrp-font-display);
    color: var(--rrp-text);
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a {
    color: var(--rrp-text-dim);
    font-size: 14px;
    transition: color 120ms ease;
}
.footer-col ul a:hover { color: var(--rrp-accent); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--rrp-border-soft);
    font-size: 13px;
    color: var(--rrp-text-muted);
}
.footer-bottom .built-by {
    font-family: var(--rrp-font-body);
}

@media (max-width: 980px) {
    .footer-cols {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}
@media (max-width: 540px) {
    .footer-cols {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* =========================================================================
   NOTICE / MARQUEE BAR (used at top of dept pages)
   ========================================================================= */

.notice-bar {
    background: var(--rrp-glass);
    border-top: 1px solid var(--rrp-border-soft);
    border-bottom: 1px solid var(--rrp-border-soft);
    overflow: hidden;
    position: relative;
}
.notice-bar-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 0;
    white-space: nowrap;
    animation: marquee 40s linear infinite;
}
.notice-bar .notice-tag {
    flex: 0 0 auto;
    font-family: var(--rrp-font-display);
    background: var(--rrp-accent);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--rrp-r-sm);
    font-size: 12px;
    letter-spacing: 1.5px;
}
.notice-bar .notice-text {
    color: var(--rrp-text-body);
    font-size: 14px;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ============================================================================
   Panel switcher (topbar dropdown)
   Native <details>/<summary> — no JS needed for show/hide.
   ============================================================================ */

.panel-switcher {
    position: relative;
}
.panel-switcher summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--admin-border-strong);
    border-radius: 4px;
    color: var(--rrp-text-body);
    font-family: var(--rrp-font-display);
    font-size: 13px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: color 100ms, border-color 100ms, background-color 100ms;
}
.panel-switcher summary::-webkit-details-marker { display: none; }
.panel-switcher summary:hover {
    color: var(--rrp-text);
    border-color: var(--rrp-accent);
}
.panel-switcher[open] summary {
    color: var(--rrp-text);
    border-color: var(--rrp-accent);
    background: rgba(225, 0, 50, 0.06);
}
.panel-switcher .icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.panel-switcher-current {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.panel-switcher-chevron {
    transition: transform 120ms;
    opacity: 0.7;
}
.panel-switcher[open] .panel-switcher-chevron {
    transform: rotate(180deg);
}

.panel-switcher-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 260px;
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-strong);
    border-radius: 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    padding: 6px;
    z-index: 1000;
}

.panel-switcher-heading {
    font-family: var(--rrp-font-display);
    font-size: 10px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--rrp-text-dim);
    padding: 6px 10px 8px;
    border-bottom: 1px solid var(--admin-border);
    margin-bottom: 4px;
}

.panel-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 3px;
    color: var(--rrp-text-body);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 80ms, color 80ms;
}
.panel-switcher-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--rrp-text);
}
.panel-switcher-item.active {
    background: rgba(225, 0, 50, 0.08);
    color: var(--rrp-text);
}

/* Portal link variant — different role (leave admin → go to user portal),
   so visually distinct from the panel items themselves. */
.panel-switcher-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 3px;
    color: var(--rrp-text);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 80ms;
}
.panel-switcher-link:hover {
    background: rgba(255, 255, 255, 0.04);
}
.panel-switcher-link svg:first-of-type {
    color: var(--rrp-text-dim);
    flex-shrink: 0;
}
.panel-switcher-divider {
    height: 1px;
    background: var(--admin-border);
    margin: 4px 2px;
}
.panel-switcher-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--rrp-text-dim);
}
.panel-switcher-dot-director {
    background: var(--rrp-accent);
    box-shadow: 0 0 0 2px rgba(225, 0, 50, 0.2);
}
