/* Mac OS Classic (Mac OS 8/9 "Platinum") theme.
   Greys, window bevels and the striped title bar follow platinum.css by Mat Sz
   (BSD-3-Clause-Clear, https://github.com/mat-sz/platinum.css), adapted to this app's
   class names. The Charcoal font is Apple's and is not bundled: it is used only when
   installed, otherwise Geneva / system fonts. Active only with <html data-theme="macclassic">. */

:root[data-theme="macclassic"] {
    --bg: #5d64a8;
    --panel: #dedede;
    --panel-light: #eeeeee;
    --text: #000000;
    --muted: #333333;
    --accent: #1f1f8f;
    --focus: #3333cc;
    --link: #0000cc;
    --visited: #551a8b;
    --shadow: rgba(0, 0, 0, 0.45);
}

:root[data-theme="macclassic"] body {
    font-family: Charcoal, Chicago, Geneva, "Lucida Grande", Verdana, sans-serif;
    /* Periwinkle desktop with a fine dot pattern. */
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1.5px) 0 0 / 4px 4px,
        #5d64a8;
}

/* ── Windows ───────────────────────────────────────────────────────────── */

:root[data-theme="macclassic"] .app-header,
:root[data-theme="macclassic"] .admin-header,
:root[data-theme="macclassic"] .rooms-panel,
:root[data-theme="macclassic"] .auth-panel,
:root[data-theme="macclassic"] .side-panel,
:root[data-theme="macclassic"] .chat-panel,
:root[data-theme="macclassic"] .admin-form-section,
:root[data-theme="macclassic"] .stat-card,
:root[data-theme="macclassic"] .faq-section {
    background: var(--panel);
    border: 1px solid #000000;
    border-radius: 0;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #9c9c9c, 2px 2px 0 var(--shadow);
}

/* Title bars: name in the middle, pinstripe lines on both sides. */
:root[data-theme="macclassic"] .rooms-panel h2,
:root[data-theme="macclassic"] .auth-panel h2,
:root[data-theme="macclassic"] .side-panel h2,
:root[data-theme="macclassic"] .faq-section-title,
:root[data-theme="macclassic"] .faq-title,
:root[data-theme="macclassic"] .section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #cecece;
    color: #000000;
    border: 0;
    border-bottom: 1px solid #000000;
    box-shadow: inset 1px 1px 0 #ffffff, inset 0 -1px 0 #9c9c9c;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    text-align: center;
    padding: 3px 6px;
}

:root[data-theme="macclassic"] .rooms-panel h2::before,
:root[data-theme="macclassic"] .rooms-panel h2::after,
:root[data-theme="macclassic"] .auth-panel h2::before,
:root[data-theme="macclassic"] .auth-panel h2::after,
:root[data-theme="macclassic"] .side-panel h2::before,
:root[data-theme="macclassic"] .side-panel h2::after,
:root[data-theme="macclassic"] .faq-section-title::before,
:root[data-theme="macclassic"] .faq-section-title::after,
:root[data-theme="macclassic"] .faq-title::before,
:root[data-theme="macclassic"] .faq-title::after,
:root[data-theme="macclassic"] .section-title::before,
:root[data-theme="macclassic"] .section-title::after {
    content: "";
    flex: 1 1 0;
    min-width: 12px;
    height: 11px;
    background: repeating-linear-gradient(180deg, #ffffff 0, #ffffff 1px, #737373 1px, #737373 2px);
}

:root[data-theme="macclassic"] .rooms-panel h2,
:root[data-theme="macclassic"] .auth-panel h2,
:root[data-theme="macclassic"] .side-panel h2 {
    margin: -12px -12px 10px;
}

:root[data-theme="macclassic"] .faq-section-title {
    margin: -10px -10px 10px;
}

:root[data-theme="macclassic"] .faq-title,
:root[data-theme="macclassic"] .section-title {
    border: 1px solid #000000;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #9c9c9c, 2px 2px 0 var(--shadow);
}

:root[data-theme="macclassic"] .faq-title {
    font-size: 1rem;
    font-weight: 700;
}

/* The room bar: a window header with a white-to-grey bevel. */
:root[data-theme="macclassic"] .chat-top {
    margin: -12px -12px 0;
    padding: 6px 12px;
    background: #cecece;
    border-bottom: 1px solid #000000;
    box-shadow: inset 1px 1px 0 #ffffff, inset 0 -1px 0 #9c9c9c;
}

:root[data-theme="macclassic"] .chat-top h2,
:root[data-theme="macclassic"] .brand-name {
    text-transform: none;
    letter-spacing: 0;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

:root[data-theme="macclassic"] .button {
    color: #000000;
    background: #dddddd;
    border: 1px solid #000000;
    border-radius: 4px;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #888888;
    font-weight: 400;
}

:root[data-theme="macclassic"] .button:hover {
    background: #e6e6e6;
}

:root[data-theme="macclassic"] .button:active {
    border-color: #000000;
    background: #8c8c8c;
    color: #ffffff;
    box-shadow: inset 1px 1px 0 #5e5e5e, inset -1px -1px 0 #b0b0b0;
}

/* Default button: the thick outer ring. */
:root[data-theme="macclassic"] .button.primary {
    color: #000000;
    background: #dddddd;
    font-weight: 700;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #888888, 0 0 0 2px #dedede, 0 0 0 3px #000000;
}

/* Selected tab / room: highlighted in the classic lavender selection colour. */
:root[data-theme="macclassic"] .button.active {
    background: #ccccff;
    color: #000000;
    font-weight: 700;
    border-color: #000000;
    box-shadow: inset 1px 1px 0 #8888bb, inset -1px -1px 0 #eeeeff;
}

/* ── Fields ────────────────────────────────────────────────────────────── */

:root[data-theme="macclassic"] textarea,
:root[data-theme="macclassic"] input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="macclassic"] .admin-textarea,
:root[data-theme="macclassic"] .message-pane,
:root[data-theme="macclassic"] .ai-log-scroll {
    background-color: #ffffff;
    border: 1px solid;
    border-color: #737373 #ffffff #ffffff #737373;
    border-radius: 0;
    box-shadow: inset 1px 1px 0 #000000;
}

/* Pop-up menu: a bevelled button with a black triangle. */
:root[data-theme="macclassic"] select {
    appearance: none;
    -webkit-appearance: none;
    color: #000000;
    border: 1px solid #000000;
    border-radius: 3px;
    padding-right: 24px;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #888888, 1px 1px 0 #737373;
    background: #dddddd url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' viewBox='0 0 9 5'%3E%3Cpath d='M0 0h9L4.5 5z' fill='%23000'/%3E%3C/svg%3E") no-repeat right 8px center;
}

:root[data-theme="macclassic"] .status-pill {
    background: #ffffff;
    border: 1px solid;
    border-color: #737373 #ffffff #ffffff #737373;
    box-shadow: inset 1px 1px 0 #000000;
}

:root[data-theme="macclassic"] .ai-fieldset {
    border: 1px solid;
    border-color: #9c9c9c #ffffff #ffffff #9c9c9c;
}

:root[data-theme="macclassic"] textarea:focus,
:root[data-theme="macclassic"] input:focus,
:root[data-theme="macclassic"] select:focus,
:root[data-theme="macclassic"] .button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 0;
}

/* ── Messages, lists ───────────────────────────────────────────────────── */

:root[data-theme="macclassic"] .message,
:root[data-theme="macclassic"] .msg-row,
:root[data-theme="macclassic"] .faq-item {
    background: #eeeeee;
    border: 1px solid #b5b5b5;
    border-radius: 0;
}

:root[data-theme="macclassic"] .message.own {
    background: #e6e6ff;
    border-color: #9999cc;
}

:root[data-theme="macclassic"] .message.mentions-me {
    background: #eeeeff;
    border-left: 4px solid #3333aa;
}

:root[data-theme="macclassic"] .message-header {
    font-family: Monaco, Menlo, "Courier New", monospace;
}

:root[data-theme="macclassic"] .participant {
    background: #ffffff;
    border: 1px solid #b5b5b5;
}

:root[data-theme="macclassic"] .participant.outside {
    border-style: dashed;
    background: #f4f4f4;
}

/* Menus: grey, square, black frame, blue highlight. */
:root[data-theme="macclassic"] .mention-list {
    background: #dedede;
    border: 1px solid #000000;
    box-shadow: 2px 2px 0 var(--shadow);
}

:root[data-theme="macclassic"] .mention-list li.active,
:root[data-theme="macclassic"] .mention-list li:hover {
    background: #3131ad;
    color: #ffffff;
}

:root[data-theme="macclassic"] .mention {
    color: #1f1f8f;
    background: #e0e0ff;
}

:root[data-theme="macclassic"] .history-indicator {
    background: #ffffcc;
    border-color: #000000;
}

:root[data-theme="macclassic"] .admin-table {
    background: #ffffff;
    border: 1px solid #000000;
}

:root[data-theme="macclassic"] .admin-table th {
    background: #dedede;
    color: #000000;
    border: 1px solid #737373;
    box-shadow: inset 1px 1px 0 #ffffff;
    text-transform: none;
    letter-spacing: 0;
}

:root[data-theme="macclassic"] .admin-table td {
    border-color: #cccccc;
}

:root[data-theme="macclassic"] .admin-table tbody tr:nth-child(even) td {
    background: #f0f0f0;
}

/* FAQ page text sits on the desktop. */
:root[data-theme="macclassic"] .faq-back,
:root[data-theme="macclassic"] .faq-back:visited,
:root[data-theme="macclassic"] .faq-subtitle {
    color: #ffffff;
    text-shadow: 1px 1px 0 #1d2155;
}
