/* Barber Turns TV-mode styling (compact 70%). */

.view-tv {
    min-height: 100vh;
    padding: 1.26rem clamp(0.7rem, 2.1vw, 2.1rem);
    display: flex;
    flex-direction: column;
    gap: 0.84rem;
    background: #ffffff;
    font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.view-tv.view-tv--error {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.view-tv.view-tv--error h2 {
    font-size: 1.54rem;
    margin-bottom: 0.75rem;
}

.view-tv.view-tv--error .tv-error {
    font-size: 0.84rem;
    max-width: 40ch;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.tv-header-wrap {
    width: 100%;
    margin-bottom: 22.4px;
}

.tv-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem clamp(0.7rem, 1.75vw, 1.12rem);
    background: #c11217;
    border-radius: 11.2px;
    box-shadow: 0 8.4px 16.8px rgba(193, 18, 23, 0.28);
    color: #ffffff;
}

.tv-header h2 {
    margin: 0;
    text-align: center;
    font-size: clamp(1.26rem, 1.82vw, 1.68rem);
    letter-spacing: 0.04em;
}

.tv-header__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
}

.tv-subtitle {
    margin: 0;
    font-size: clamp(0.56rem, 0.91vw, 0.7rem);
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.112em;
    text-transform: uppercase;
}

.tv-updated {
    margin: 0;
    font-size: clamp(0.525rem, 0.77vw, 0.665rem);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.tv-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: clamp(0.54rem, 0.85vw, 0.7rem);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tv-toggle:hover,
.tv-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.8);
    outline: none;
}

.tv-toggle[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.95);
}

.tv-toggle__label {
    opacity: 0.85;
}

.tv-toggle__state {
    font-weight: 700;
    letter-spacing: 0.06em;
}

.tv-alert {
    padding: 0.63rem 0.7rem;
    border-radius: 8.4px;
    background: rgba(255, 102, 102, 0.16);
    border-left: 3.5px solid #ff6666;
    font-size: clamp(0.665rem, 1.19vw, 0.84rem);
    color: #ffb3b3;
}

.tv-queue-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.tv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(0.5rem, 1.4vw, 0.7rem);
    width: 100%;
    margin: 0 auto;
    max-width: min(100%, 980px);
}

.tv-empty {
    width: 100%;
    text-align: center;
    font-size: clamp(0.98rem, 1.68vw, 1.4rem);
    color: #64748b;
}

.tv-card {
    position: relative;
    padding: 0.7rem 0.84rem;
    border-radius: 9.8px;
    background: #ffffff;
    border-left: 5.6px solid transparent;
    box-shadow: 0 7px 18.2px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.46rem;
    width: 100%;
    min-height: 0;
}

.tv-card__header {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.42rem;
    width: 100%;
    position: relative;
}

.tv-position {
    margin: 0;
    font-size: clamp(0.595rem, 0.98vw, 0.7rem);
    color: #64748b;
    letter-spacing: 0.056em;
    order: -1;
}

.tv-name {
    margin: 0;
    font-size: clamp(1.19rem, 2.66vw, 1.68rem);
    font-weight: 600;
    letter-spacing: 0.021em;
    color: #0f172a;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv-card__footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}

.tv-status {
    margin: 0;
    font-size: clamp(0.595rem, 1.26vw, 0.77rem);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #475569;
}

.tv-timer {
    margin: 0;
    font-size: clamp(1.12rem, 2.94vw, 1.82rem);
    font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    letter-spacing: 0.07em;
    color: #0f172a;
}

.tv-grid.is-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    max-width: 364px;
}

.tv-grid:not(.is-vertical) .tv-card {
    padding-top: 1.1rem;
    align-items: stretch;
    max-width: none;
}

.tv-grid:not(.is-vertical) .tv-position {
    position: absolute;
    top: 0;
    right: 0;
    order: initial;
}

.tv-grid:not(.is-vertical) .tv-card__header {
    width: 100%;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 2.2rem;
}

.tv-grid:not(.is-vertical) .tv-name {
    width: 100%;
}

.tv-grid:not(.is-vertical) .tv-card__footer {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tv-grid:not(.is-vertical) .tv-status {
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    white-space: nowrap;
}

.tv-grid:not(.is-vertical) .tv-timer {
    margin-left: auto;
}

.tv-grid.is-vertical .tv-card {
    max-width: 294px;
}

.tv-grid.is-vertical .tv-position {
    position: static;
}


.tv-grid.is-vertical .tv-card__header {
    flex-direction: row;
    align-items: baseline;
    gap: 0.42rem;
    padding-right: 0;
    position: static;
}

.tv-grid.is-vertical .tv-card__footer {
    flex-direction: column;
}

.tv-grid.is-vertical .tv-status {
    background: none;
    padding: 0;
    white-space: normal;
}

.tv-grid.is-vertical .tv-timer {
    align-self: flex-start;
}

.tv-card[data-status="available"] {
    border-left-color: #2ecc71 !important;
    background: rgba(46, 204, 113, 0.16) !important;
}

.tv-card[data-status="busy_walkin"] {
    border-left-color: #ff5b5b !important;
    background: rgba(255, 91, 91, 0.18) !important;
}

.tv-card[data-status="busy_appointment"] {
    border-left-color: #f5a623 !important;
    background: rgba(245, 166, 35, 0.18) !important;
}

.tv-card[data-status="inactive"] {
    border-left-color: #94a3b8 !important;
    background: rgba(148, 163, 184, 0.2) !important;
    color: #475569;
}

@media (min-width: 1200px) {
    .view-tv {
        padding: 1.4rem clamp(0.7rem, 1.82vw, 1.96rem);
    }

    .tv-grid {
        max-width: min(100%, 1120px);
    }

    .tv-grid.is-vertical {
        max-width: 392px;
    }

    .tv-card {
        padding: 0.8rem 1rem;
    }

    .tv-grid.is-vertical .tv-card {
        padding: 0.77rem 0.91rem;
    }
}
