/* * UNIQUE PREFIX: "ohs-" (Opa HiAI Show)
 * SCOPE: All styles are scoped to #ohs-wrapper to prevent bleeding
 */

:root {
    /* Color Palette - Pixar-esque Pastel & Vibrant */
    --ohs-primary: #6c5ce7;
    --ohs-primary-dark: #5649c0;
    --ohs-accent: #00cec9;
    --ohs-bg: #dfe6e9;
    --ohs-surface: #ffffff;
    --ohs-text: #2d3436;
    --ohs-text-muted: #636e72;
    --ohs-border: #b2bec3;
    --ohs-error: #ff7675;
    --ohs-success: #55efc4;

    /* Screen Specific Theme Colors (Light/Bg) */
    --ohs-theme-1: #74b9ff;
    /* Details - Light Blue */
    --ohs-theme-1-bg: #e7f2ff;
    --ohs-theme-1-main: #0984e3;
    /* Darker Blue for Text/Buttons */

    --ohs-theme-2: #a29bfe;
    /* Clips - Light Indigo */
    --ohs-theme-2-bg: #f2f0ff;
    --ohs-theme-2-main: #6c5ce7;
    /* Darker Indigo */

    --ohs-theme-3: #55efc4;
    /* Cast - Light Mint */
    --ohs-theme-3-bg: #eafff9;
    --ohs-theme-3-main: #00b894;
    /* Darker Mint */

    --ohs-theme-4: #ffeaa7;
    /* Actions - Light Yellow */
    --ohs-theme-4-bg: #fffbf0;
    --ohs-theme-4-main: #fdcb6e;
    /* Darker Orange/Yellow */

    --ohs-theme-5: #fd79a8;
    /* Export - Pink */
    --ohs-theme-5-bg: #fff0f6;
    --ohs-theme-5-main: #e84393;
    /* Primary Pink */

    /* Spacing & Sizing */
    --ohs-space-xs: 4px;
    --ohs-space-sm: 8px;
    --ohs-space-md: 16px;
    --ohs-space-lg: 24px;
    --ohs-radius: 12px;
    --ohs-input-height: 44px;
    /* Touch target size */
    --ohs-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    /* Page background outside wrapper */
    font-family: var(--ohs-font-stack);
    overflow-x: hidden;
}

/* --- WRAPPER --- */
#ohs-wrapper {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 600px) {
    #ohs-wrapper {
        min-height: 80vh;
        margin-top: 20px;
        margin-bottom: 20px;
        max-width: 95vw;
        border-radius: var(--ohs-radius);
        border: 1px solid var(--ohs-border);
        background-color: #f0f0f0;
    }
}

/* --- NAVIGATION BAR --- */
.ohs-nav-bar {
    display: flex;
    overflow-x: auto;
    background: #fff;
    border-bottom: 1px solid var(--ohs-border);
    padding: var(--ohs-space-sm);
    gap: var(--ohs-space-xs);
    scrollbar-width: none;
    flex-shrink: 0;
}

.ohs-nav-bar::-webkit-scrollbar {
    display: none;
}

.ohs-nav-item {
    flex: 1;
    text-align: center;
    padding: 6px 4px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ohs-text-muted);
    background: var(--ohs-bg);
    white-space: nowrap;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ohs-nav-item:hover {
    opacity: 0.9;
}

/* Active state handled via inline styles in JS now */
.ohs-nav-item.disabled {
    opacity: 0.5;
    cursor: default;
}

/* --- TYPOGRAPHY --- */
.ohs-h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ohs-primary);
    margin: 0 0 var(--ohs-space-xs) 0;
    text-align: center;
}

.ohs-h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: var(--ohs-space-sm);
    color: var(--theme-primary, var(--ohs-text));
    /* Use local theme color */
}

.ohs-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ohs-text-muted);
    margin-bottom: var(--ohs-space-xs);
    display: block;
}

/* --- FORMS & INPUTS --- */
.ohs-input,
.ohs-select,
.ohs-textarea {
    width: 100%;
    box-sizing: border-box;
    height: var(--ohs-input-height);
    padding: 0 var(--ohs-space-sm);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--ohs-radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

.ohs-textarea {
    height: auto;
    padding: var(--ohs-space-sm);
    resize: vertical;
    min-height: 120px;
    margin-bottom: var(--ohs-space-md);
}

.ohs-textarea-compact {
    min-height: 180px;
    height: 42vh;
    margin-bottom: var(--ohs-space-sm);
}

/* --- PROMPT TEMPLATES (compact, mobile-first) --- */
.ohs-templates-body {
    padding-bottom: var(--ohs-space-sm);
}

.ohs-at-wrap {
    position: relative;
}

.ohs-at-suggest {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - var(--ohs-space-sm));
    z-index: 20;
    max-height: 180px;
    overflow: auto;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--ohs-radius);
    background: rgba(255, 255, 255, 0.98);
}

.ohs-at-item {
    padding: var(--ohs-space-xs) var(--ohs-space-sm);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
}

.ohs-at-item:last-child {
    border-bottom: none;
}

.ohs-at-item.is-active {
    font-weight: 700;
    background: rgba(0, 0, 0, 0.06);
}

.ohs-input:focus,
.ohs-select:focus,
.ohs-textarea:focus {
    outline: none;
    border-color: var(--theme-primary, var(--ohs-primary));
    /* Use local theme */
    background: #fff;
}

/* --- BUTTONS --- */
.ohs-btn {
    width: 100%;
    height: var(--ohs-input-height);
    border: none;
    border-radius: var(--ohs-radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ohs-btn:active {
    transform: scale(0.98);
}

/* Primary Button adapts to Card Theme */
.ohs-btn-primary {
    background-color: var(--theme-primary, var(--ohs-primary));
    color: white;
}

.ohs-btn-secondary {
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--ohs-text);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ohs-btn-icon {
    background: transparent;
    color: var(--ohs-text-muted);
    border: none;
    font-size: 1.2rem;
    padding: 0 var(--ohs-space-xs);
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ohs-btn-icon:hover {
    color: var(--ohs-error);
}

.ohs-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--ohs-bg);
    color: var(--ohs-text-muted);
}

/* --- LAYOUT UTILS --- */
.ohs-header {
    padding: var(--ohs-space-md);
    border-bottom: 1px solid var(--ohs-bg);
    background: #fff;
    flex-shrink: 0;
    z-index: 10;
}

/* --- HORIZONTAL SCROLL CONTAINER --- */
.ohs-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: var(--ohs-space-md) 0;
    gap: var(--ohs-space-md);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ohs-content::-webkit-scrollbar {
    display: none;
}

/* --- SCREEN CARD STYLES --- */
.ohs-screen-card {
    flex: 0 0 85%;
    scroll-snap-align: center;
    background: #fff;
    border-radius: var(--ohs-radius);
    padding: var(--ohs-space-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    opacity: 0.5;
    transform: scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
    margin-left: 0;
    position: relative;
    overflow: hidden;
}

/* Theme Mapping using CSS Variables Scope */
#ohs-screen-1 {
    --theme-bg: var(--ohs-theme-1-bg);
    --theme-primary: var(--ohs-theme-1-main);
    background-color: var(--theme-bg);
    border-color: var(--ohs-theme-1);
}

#ohs-screen-2 {
    --theme-bg: var(--ohs-theme-2-bg);
    --theme-primary: var(--ohs-theme-2-main);
    background-color: var(--theme-bg);
    border-color: var(--ohs-theme-2);
}

#ohs-screen-3 {
    --theme-bg: var(--ohs-theme-3-bg);
    --theme-primary: var(--ohs-theme-3-main);
    background-color: var(--theme-bg);
    border-color: var(--ohs-theme-3);
}

#ohs-screen-4 {
    --theme-bg: var(--ohs-theme-4-bg);
    --theme-primary: var(--ohs-theme-4-main);
    background-color: var(--theme-bg);
    border-color: var(--ohs-theme-4);
}

#ohs-screen-5 {
    --theme-bg: var(--ohs-theme-5-bg);
    --theme-primary: var(--ohs-theme-5-main);
    background-color: var(--theme-bg);
    border-color: var(--ohs-theme-5);
}

#ohs-screen-0 {
    flex: 1 1 100%;
    width: 100%;
    opacity: 1;
    transform: scale(1);
    background-color: var(--ohs-bg);
}

#ohs-screen-6 {
    flex: 1 1 100%;
    width: 100%;
    opacity: 1;
    transform: scale(1);
    background-color: var(--ohs-surface);
    border: none;
    padding: var(--ohs-space-lg);
}

.ohs-card-body {
    flex: 1;
    overflow-y: auto;
    margin-bottom: var(--ohs-space-md);
}

.ohs-card-footer {
    display: flex;
    gap: var(--ohs-space-sm);
    margin-top: auto;
    padding-top: var(--ohs-space-sm);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ohs-screen-card:first-child {
    margin-left: 7.5%;
}

.ohs-screen-card:last-child {
    margin-right: 7.5%;
}

.ohs-screen-card.active-screen {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

@media (min-width: 600px) {
    .ohs-screen-card {
        flex: 0 1 920px;
        width: 100%;
        max-width: 920px;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .ohs-content {
        padding: 20px;
    }
}

/* --- TABLE STYLES --- */
.ohs-table-wrapper {
    overflow-x: auto;
    border-radius: var(--ohs-radius);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: var(--ohs-space-md);
}

.ohs-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 300px;
}

.ohs-table th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--ohs-text-muted);
    font-size: 0.8rem;
    text-align: left;
    padding: var(--ohs-space-sm);
    font-weight: 600;
}

.ohs-table td {
    padding: var(--ohs-space-sm);
    border-bottom: 1px solid var(--ohs-bg);
    vertical-align: middle;
}

.ohs-table tr:last-child td {
    border-bottom: none;
}

.ohs-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.ohs-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Table Selection uses Theme Color */
.ohs-table tbody tr.selected {
    background-color: rgba(255, 255, 255, 0.7);
    border-left: 4px solid var(--theme-primary, var(--ohs-primary));
}

.ohs-table tbody tr.selected .ohs-input,
.ohs-table tbody tr.selected .ohs-select {
    border-color: var(--theme-primary, var(--ohs-primary));
}

.ohs-table-row-draft {
    background-color: #fafafa;
    opacity: 0.8;
}

/* --- COMPACT ACTION/CAST ROWS --- */
.ohs-action-header-row {
    display: flex;
    gap: 4px;
    padding: 0 var(--ohs-space-xs);
    margin-bottom: 4px;
}

.ohs-col-header {
    font-size: 0.75rem;
    color: var(--ohs-text-muted);
    font-weight: 600;
}

.ohs-action-row-compact {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 8px;
    background: #fff;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid transparent;
}

/* Generic Cols */
.ohs-col-del {
    width: 8%;
    min-width: 32px;
}

/* Action Cols */
.ohs-col-actor {
    width: 20%;
    min-width: 70px;
}

.ohs-col-type {
    width: 17%;
    min-width: 60px;
}

.ohs-col-action {
    flex: 1;
}

/* Cast Cols (Screen 3) */
.ohs-col-cast-name {
    width: 35%;
    min-width: 100px;
}

.ohs-col-cast-silent {
    width: 15%;
    min-width: 50px;
    display: flex;
    justify-content: center;
}

.ohs-col-cast-loc {
    width: 40%;
    min-width: 100px;
}

.ohs-col-cast-del {
    width: 10%;
    min-width: 30px;
    display: flex;
    justify-content: flex-end;
}

/* --- MOBILE-FIRST SPACING & UTILITY CLASSES --- */
.ohs-input-spacing {
    margin-bottom: var(--ohs-space-md);
}

.ohs-btn-full {
    width: 100%;
}

.ohs-btn-half {
    flex: 1;
}

.ohs-btn-double {
    flex: 2;
}

.ohs-copy-btn {
    margin-top: var(--ohs-space-md);
}

.ohs-text-right {
    text-align: right;
}

.ohs-action-cell {
    white-space: nowrap;
}

/* --- MAIN MENU SCREEN (Screen 0) - Mobile First --- */
.ohs-main-menu-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--ohs-space-md);
    min-height: 300px;
}

.ohs-main-menu-title {
    text-align: center;
    width: 100%;
}

.ohs-main-menu-subtitle {
    text-align: center;
    color: var(--ohs-text-muted);
    margin-bottom: var(--ohs-space-md);
    font-size: 0.95rem;
    width: 100%;
}

.ohs-main-menu-btn {
    width: 100%;
    max-width: 280px;
    padding: var(--ohs-space-md);
    font-size: 1rem;
}

/* --- GRID LAYOUT FOR MOBILE --- */
.ohs-row-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ohs-space-xs);
}

/* --- BIBLE SCREEN COLUMNS --- */
.ohs-bible-col-name {
    flex: 1;
}

.ohs-bible-col-value {
    flex: 2;
}

.ohs-bible-col-action {
    width: 40px;
}

/* --- CHARACTER BIBLE ROW LAYOUT --- */
.ohs-bible-row {
    display: flex;
    align-items: center;
    gap: var(--ohs-space-sm);
    width: 100%;
    margin-bottom: var(--ohs-space-sm);
}

.ohs-bible-key {
    flex: 1;
    min-width: 0;
}

.ohs-bible-value {
    flex: 2;
    min-width: 0;
}

.ohs-bible-del {
    flex: 0 0 40px;
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ohs-action-row-compact .ohs-input,
.ohs-action-row-compact .ohs-select {
    font-size: 0.9rem;
    padding: 0 4px;
    border-radius: 6px;
}

.ohs-action-draft {
    opacity: 0.6;
}

.ohs-hint {
    font-size: 0.8rem;
    color: var(--ohs-text-muted);
    text-align: center;
    margin-top: var(--ohs-space-md);
}