﻿/* ================================================================
   ReadySetShow.css
   Shared stylesheet for Ready-Set-Show application
   ================================================================ */

/* ----------------------------------------------------------------
   Reset & base
   ---------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, sans-serif;
    background: #111;
    color: #eee;
}

/* ----------------------------------------------------------------
   Typography helpers
   ---------------------------------------------------------------- */
.mono {
    font-family: monospace;
}

.upper {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ----------------------------------------------------------------
   Common form elements (dark theme)
   ---------------------------------------------------------------- */
input[type=text],
input[type=password] {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #eee;
    font-family: inherit;
    width: 100%;
}

    input[type=text]:focus,
    input[type=password]:focus {
        outline: none;
        border-color: #555;
    }

select {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: #eee;
    font-family: inherit;
    width: 100%;
}

button {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

    button:active {
        opacity: 0.8;
        transform: scale(0.97);
    }

/* ----------------------------------------------------------------
   Button colours
   ---------------------------------------------------------------- */
.btn-go {
    background: #1a6e2e;
    color: #fff;
}

.btn-standby {
    background: #9a6f00;
    color: #fff;
}

.btn-hold {
    background: #7a1010;
    color: #fff;
}

.btn-idle {
    background: #333;
    color: #aaa;
}

.btn-send {
    background: #1a4a8a;
    color: #fff;
}

.btn-log {
    background: #9a6f00;
    color: #fff;
}

.btn-neutral {
    background: #333;
    color: #aaa;
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}

button:hover {
    opacity: 0.88;
}

/* ----------------------------------------------------------------
   Admin page (light)
   ---------------------------------------------------------------- */
body.admin-page {
    background: #fff;
    color: #222;
    max-width: 780px;
    margin: 2rem auto;
    padding: 0 1rem;
}

    body.admin-page h1 {
        font-size: 1.4rem;
        font-weight: 500;
        margin-bottom: 1.5rem;
    }

    body.admin-page input[type=text],
    body.admin-page input[type=password] {
        background: #fff;
        border: 1px solid #ccc;
        color: #222;
        border-radius: 6px;
        padding: 6px 10px;
        font-size: 14px;
    }

    body.admin-page button {
        border: 1px solid #bbb;
        border-radius: 6px;
        padding: 5px 12px;
        font-size: 12px;
        background: #f5f5f5;
        color: #222;
        white-space: nowrap;
    }

        body.admin-page button:hover {
            background: #e8e8e8;
        }

        body.admin-page button.danger {
            border-color: #e53935;
            color: #e53935;
            background: #fff;
        }

            body.admin-page button.danger.armed {
                background: #e53935;
                color: #fff;
            }

        body.admin-page button.warn {
            border-color: #f59e0b;
            color: #92400e;
            background: #fff;
        }

            body.admin-page button.warn.armed {
                background: #f59e0b;
                color: #fff;
            }

    body.admin-page table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }

    body.admin-page th {
        text-align: left;
        padding: 6px 8px;
        border-bottom: 2px solid #ddd;
        color: #666;
        font-weight: 500;
    }

    body.admin-page td {
        padding: 6px 8px;
        border-bottom: 1px solid #eee;
        vertical-align: middle;
    }

    body.admin-page .mono {
        font-family: monospace;
        font-size: 12px;
        color: #444;
    }

    body.admin-page .actions {
        display: flex;
        gap: 5px;
        flex-wrap: wrap;
    }

    body.admin-page .url {
        font-size: 11px;
        color: #888;
        font-family: monospace;
    }

        body.admin-page .url a {
            color: #1a6e2e;
            text-decoration: none;
        }

            body.admin-page .url a:hover {
                text-decoration: underline;
            }

    body.admin-page #msg {
        font-size: 13px;
        color: #4caf50;
        margin-bottom: 0.5rem;
        min-height: 20px;
    }

    body.admin-page #new-show {
        display: flex;
        gap: 8px;
        margin-bottom: 1rem;
    }

    body.admin-page #auth {
        margin-bottom: 1.5rem;
        display: flex;
        gap: 8px;
    }

/* ----------------------------------------------------------------
   Index / splash page
   ---------------------------------------------------------------- */
body.index-page {
    min-height: 90vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

    .brand h1 {
        font-size: clamp(2rem, 8vw, 3.5rem);
        font-weight: 700;
        letter-spacing: -0.02em;
        color: #fff;
    }

        .brand h1 span {
            color: #9a6f00;
        }

    .brand .by {
        font-size: 13px;
        color: #555;
        margin-top: 0.5rem;
    }

        .brand .by strong {
            color: #888;
            font-weight: 500;
        }

.index-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    border: none;
    border-radius: 10px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    min-width: 90px;
    transition: opacity 0.15s;
}

    .action-btn:hover {
        opacity: 0.85;
    }

    .action-btn.active {
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

.btn-show {
    background: #1a6e2e;
    color: #fff;
}

.btn-send {
    background: #1a4a8a;
    color: #fff;
}

.btn-log {
    background: #9a6f00;
    color: #fff;
}

.panel {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    margin-bottom: 1.5rem;
}

    .panel.visible {
        display: flex;
    }

.go-btn {
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    width: 100%;
}

    .go-btn:hover {
        opacity: 0.85;
    }

.go-show {
    background: #1a6e2e;
}

.go-send {
    background: #1a4a8a;
}

.go-log {
    background: #9a6f00;
}

.field-row {
    display: flex;
    gap: 8px;
}

    .field-row input:first-child {
        flex: 1;
    }

    .field-row input:last-child {
        flex: 0 0 90px;
    }

.err {
    font-size: 12px;
    color: #e53935;
    text-align: center;
    display: none;
}

.text-links {
    font-size: 13px;
    color: #444;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

    .text-links a {
        color: #555;
        text-decoration: none;
        padding: 0 8px;
    }

        .text-links a:hover {
            color: #aaa;
        }

#show-name {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #9a6f00;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    min-height: 22px;
}

/* ----------------------------------------------------------------
   Send page
   ---------------------------------------------------------------- */
body.send-page {
    min-height: 90vh;
    min-height: 100dvh;
    padding: 1rem;
}

    body.send-page h1 {
        font-size: 1.1rem;
        font-weight: 500;
        color: #888;
        margin-bottom: 1.5rem;
    }

.section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #555;
    margin-bottom: 8px;
}

.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

    .btn-grid button {
        font-size: 15px;
        padding: 14px 10px;
    }

.row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

    .row select {
        flex: 0 0 150px;
    }

    .row input {
        flex: 1;
    }

.freeform-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

    .freeform-row input {
        flex: 1;
        font-family: monospace;
        font-size: 13px;
    }

.divider {
    border: none;
    border-top: 1px solid #222;
    margin: 1.5rem 0;
}

#msg.ok {
    color: #4caf50;
}

#msg.err {
    color: #e53935;
}

#msg {
    font-size: 13px;
    min-height: 20px;
    margin-top: 1rem;
    text-align: center;
}

#transcript {
    margin-top: 1.5rem;
    border-top: 1px solid #222;
    padding-top: 1rem;
}

#transcript-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #555;
    margin-bottom: 8px;
}

#transcript-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tx-entry {
    font-size: 12px;
    font-family: monospace;
    color: #888;
    padding: 3px 0;
    border-bottom: 1px solid #1a1a1a;
}

    .tx-entry .tx-time {
        color: #555;
        margin-right: 6px;
    }

    .tx-entry .tx-cmd {
        color: #aaa;
    }

    .tx-entry .tx-log {
        color: #4caf50;
        margin-left: 8px;
    }

    .tx-entry .tx-err {
        color: #e53935;
    }

/* ----------------------------------------------------------------
   Log page
   ---------------------------------------------------------------- */
body.log-page {
    padding: 1rem;
}

    body.log-page h1 {
        font-size: 1.1rem;
        font-weight: 500;
        color: #888;
        margin-bottom: 1rem;
    }

.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    align-items: center;
}

    .toolbar button {
        background: #333;
        color: #eee;
        padding: 7px 14px;
        font-size: 13px;
        border-radius: 6px;
    }

        .toolbar button:hover {
            background: #444;
        }

#log-msg {
    font-size: 12px;
    color: #555;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .log-table th {
        text-align: left;
        padding: 6px 10px;
        border-bottom: 1px solid #333;
        color: #555;
        font-weight: 500;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    .log-table td {
        padding: 8px 10px;
        border-bottom: 1px solid #1e1e1e;
        vertical-align: top;
    }

    .log-table .ts {
        font-family: monospace;
        color: #666;
        white-space: nowrap;
    }

    .log-table .lap {
        font-family: monospace;
        color: #4caf50;
        white-space: nowrap;
    }

    .log-table .text {
        color: #eee;
    }

    .log-table tr:hover td {
        background: #1a1a1a;
    }

#empty {
    color: #444;
    font-size: 13px;
    padding: 2rem 0;
    text-align: center;
    display: none;
}

/* ----------------------------------------------------------------
   Show page
   ---------------------------------------------------------------- */
body.show-page {
    height: 100%;
    background: #000;
    overflow: hidden;
}

html.show-page {
    height: 100%;
}

#app {
    height: 90vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

#zone-clock {
    flex: 0 0 20%;
    background: #111;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #222;
}

#show-title {
    font-size: clamp(13px, 3.5vw, 18px);
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

#clock {
    font-size: clamp(28px, 10vw, 52px);
    font-weight: 500;
    color: #eee;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

#zone-status {
    flex: 0 0 21%;
    min-height: 0;
    background: #1e1e1e;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #222;
    padding: 8px 16px;
    position: relative;
    overflow: hidden;
    transition: background 0.2s;
}

#status-msg {
    font-size: clamp(13px, 4vw, 18px);
    color: #ccc;
    text-align: center;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

#zone-status.emergency {
    background: #9b1c1c;
}

    #zone-status.emergency #status-msg {
        color: #fff;
    }

#caution {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#zone-status.emergency #caution {
    display: block;
}

#zone-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    transition: background 0.3s;
    position: relative;
}

#main-text {
    font-size: clamp(32px, 12vw, 72px);
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    text-align: center;
    padding: 0 24px;
    line-height: 1.25;
    white-space: pre-line;
}

#zone-main.go {
    background: #1a6e2e;
}

#zone-main.standby {
    background: #9a6f00;
}

#zone-main.hold {
    background: #7a1010;
}

#zone-main.idle {
    background: #111;
}

    #zone-main.idle #main-text {
        color: #444;
    }

#state-label {
    position: absolute;
    top: 0.5rem;
    left: 0.75rem;
    font-size: clamp(19px, 7.2vw, 43px);
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    letter-spacing: 0.05em;
    display: none;
}

#zone-main.go #state-label,
#zone-main.standby #state-label,
#zone-main.hold #state-label {
    display: block;
}

#zone-footer {
    flex: 0 0 28px;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-top: 1px solid #1a1a1a;
}

#conn-status {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
}

#conn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #555;
    transition: background 0.3s;
}

#conn-status.connected {
    color: #4caf50;
}

    #conn-status.connected #conn-dot {
        background: #4caf50;
    }

#conn-status.error {
    color: #e53935;
}

    #conn-status.error #conn-dot {
        background: #e53935;
    }

#conn-status.warning {
    color: #f59e0b;
}

    #conn-status.warning #conn-dot {
        background: #f59e0b;
    }

#last-update {
    font-size: 11px;
    color: #888;
}
