/* Public Timetable — horizontal EPG-style schedule (mw-pt-*) */

.mw-pt-container {
    --mw-pt-block-color: #6366f1;
    --mw-pt-accent-color: #818cf8;
    --mw-pt-bg-color: #0f172a;
    --mw-pt-text-color: #ffffff;
    --mw-pt-border-radius: 8px;
    --mw-pt-label-width: 150px;
    --mw-pt-row-height: 64px;

    background: var(--mw-pt-bg-color);
    color: var(--mw-pt-text-color);
    border-radius: 12px;
    overflow: auto;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    user-select: none;
}

/* Header (time axis) — sticky top */
.mw-pt-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--mw-pt-bg-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-width: fit-content;
}

.mw-pt-corner {
    width: var(--mw-pt-label-width);
    min-width: var(--mw-pt-label-width);
    flex-shrink: 0;
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--mw-pt-bg-color);
}

.mw-pt-timeline {
    position: relative;
    height: 36px;
    flex-shrink: 0;
}

.mw-pt-time-mark {
    position: absolute;
    top: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 0 0 6px 8px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    opacity: 0.5;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.mw-pt-time-mark-midnight {
    opacity: 0.8;
    font-weight: 700;
}

/* Stage rows */
.mw-pt-row {
    display: flex;
    min-height: var(--mw-pt-row-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    min-width: fit-content;
}

.mw-pt-row:last-child {
    border-bottom: none;
}

/* Stage label — sticky left */
.mw-pt-stage-label {
    width: var(--mw-pt-label-width);
    min-width: var(--mw-pt-label-width);
    max-width: var(--mw-pt-label-width);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--mw-pt-bg-color);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 4px 0 8px -2px rgba(0, 0, 0, 0.3);
}

.mw-pt-stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

/* Track (block container) */
.mw-pt-track {
    position: relative;
    flex-shrink: 0;
    padding: 8px 0;
}

/* Hour gridlines */
.mw-pt-gridline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

/* Act blocks */
.mw-pt-block {
    position: absolute;
    top: 8px;
    bottom: 8px;
    background: var(--mw-pt-block-color);
    border-radius: var(--mw-pt-border-radius);
    padding: 6px 12px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    min-width: 0;
}

.mw-pt-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.mw-pt-block-name {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.mw-pt-block-time {
    font-size: 10px;
    opacity: 0.65;
    white-space: nowrap;
    line-height: 1.2;
}

/* Highlighted block (viewing act in fog-of-war mode) */
.mw-pt-block-highlight {
    outline: 2px solid var(--mw-pt-text-color);
    outline-offset: 1px;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.mw-pt-block-highlight .mw-pt-block-name {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

/* Fog-of-war hidden blocks */
.mw-pt-block-hidden {
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: none;
    cursor: default;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.mw-pt-block-hidden:hover {
    transform: none;
    box-shadow: none;
}

.mw-pt-block-hidden .mw-pt-block-name {
    opacity: 0.25;
    font-style: italic;
    font-weight: 400;
}

/* Current-time indicator */
.mw-pt-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    z-index: 1;
    pointer-events: none;
}

.mw-pt-now-dot {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: #ef4444;
    z-index: 5;
    pointer-events: none;
}

.mw-pt-now-dot::before {
    content: "";
    position: absolute;
    top: -4px;
    left: -4px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
}

/* Empty state */
.mw-pt-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    opacity: 0.4;
    font-size: 14px;
}

/* Detail panel (used on test page) */
.mw-pt-detail-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.mw-pt-detail-embed {
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.mw-pt-detail-embed iframe {
    display: block;
    border: none;
}
