/* HoloBaby / InfantSim Styles */

/* Color Palette */
:root {
    --primary-maroon: #C44555;
    --secondary-teal: #4A8BA8;
    --accent-orange: #E67E3C;
    --dark-gray: #2a2a2a;
    --light-gray: #f5f5f5;
}

/* Layout */
.holobaby-layout {
    position: fixed;
    top: 64px; /* Height of MatAppBar header */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 18px; /* VR-FRIENDLY: Increased from default 16px for better readability in VR */
}

.main-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mode-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Mode Selector Container */
.mode-selector-container {
    display: flex;
    flex-direction: row;
    background-color: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

/* Mode Buttons */
.mode-buttons {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0;
    width: 100%;
    background-color: transparent;
    border-radius: 0;
}

/* Scenario Status Bar */
.scenario-status {
    padding: 0.75rem 1rem;
    background-color: #f5f5f5;
    text-align: center;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #ddd;
}

.scenario-name {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background-color: #6d1f2a;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 1.1rem; /* VR-FRIENDLY: Larger button text */
    min-height: 48px; /* VR-FRIENDLY: Larger touch targets */
}

.mode-btn:hover:not(:disabled) {
    background-color: #8a2936;
}

.mode-btn.active {
    background-color: var(--primary-maroon);
}

.mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Three Panel Layout */
.three-panel-layout {
    display: grid;
    grid-template-columns: 250px 40px 1fr 40px 300px;
    /* left-panel | left-tab | center | right-tab | right-panel */
    height: 100%;
    gap: 0;
    background-color: #000;
    overflow: hidden;
}

/* Panels */
.left-panel,
.center-panel,
.right-panel {
    background-color: white;
    overflow-y: auto;
}

.left-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-x: hidden;
}

.center-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
}

.right-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-x: hidden;
}

/* Tab Headers */
.tab-headers {
    display: none; /* Hidden in favor of vertical tab indicators */
    border-bottom: 2px solid #ddd;
}

.tab-headers.vertical {
    display: none; /* Hidden in favor of vertical tab indicators */
    flex-direction: column;
    border-bottom: none;
    border-right: 2px solid #ddd;
    width: 80px;
}

.tab-header {
    flex: 1;
    padding: 0.75rem 1rem;
    background-color: #f0f0f0;
    border: none;
    border-right: 1px solid #ddd;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    font-size: 1.1rem; /* VR-FRIENDLY: Larger tab text */
}

.tab-headers.vertical .tab-header {
    border-right: none;
    border-bottom: 1px solid #ddd;
    text-align: left;
    padding: 1rem 0.5rem;
    font-size: 0.9rem;
}

.tab-header:hover {
    background-color: #e0e0e0;
}

.tab-header.active {
    background-color: white;
    border-bottom: 2px solid var(--secondary-teal);
}

.tab-headers.vertical .tab-header.active {
    background-color: white;
    border-bottom: 1px solid #ddd;
    border-right: 2px solid var(--secondary-teal);
}

.tab-content {
    flex: 1;
    width: 100%;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Left Panel - Scenario Tab */
.scenario-tab {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scenario-info {
    padding: 0.5rem;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow: hidden;
}

/* Left Panel - States Tab */
.states-tab {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.states-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.state-btn {
    padding: 0.75rem 1.5rem; /* VR-FRIENDLY: More padding */
    border: 2px solid #ddd;
    background-color: white;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.1rem; /* VR-FRIENDLY: Larger text */
    min-height: 48px; /* VR-FRIENDLY: Larger touch targets */
}

.state-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.state-btn.selected {
    background-color: var(--secondary-teal);
    color: white;
    border-color: var(--secondary-teal);
}

.state-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

/* Action Buttons */
.action-btn {
    padding: 0.75rem 1.5rem; /* VR-FRIENDLY: More padding */
    border: none;
    border-radius: 0;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 1.1rem; /* VR-FRIENDLY: Larger button text */
    min-height: 48px; /* VR-FRIENDLY: Larger touch targets */
}

.action-btn.new {
    background-color: var(--accent-orange);
    color: white;
}

.action-btn.new:hover {
    background-color: #d46e2c;
}

.action-btn.open {
    background-color: var(--accent-orange);
    color: white;
}

.action-btn.open:hover {
    background-color: #d46e2c;
}

.action-btn.save {
    background-color: var(--accent-orange);
    color: white;
}

.action-btn.save:hover {
    background-color: #d46e2c;
}

.action-btn.delete {
    background-color: var(--primary-maroon);
    color: white;
}

.action-btn.delete:hover {
    background-color: #a33545;
}

.action-btn.add {
    background-color: var(--accent-orange);
    color: white;
}

.action-btn.add:hover {
    background-color: #d46e2c;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Right Panel - Parameter Editors */
.settings-editor,
.parameters-editor,
.setup-editor,
.present-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.param-section {
    margin-bottom: 1.5rem; /* VR-FRIENDLY: Increased spacing */
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e0e0; /* Slightly thicker divider */
    max-width: 100%;
    overflow: hidden;
}

.param-section:last-child {
    border-bottom: none; /* Remove divider from last section */
}

/* Disabled section styling for Phase 2+ features */
.param-section.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.param-section.disabled h4::after {
    content: " (Phase 2+)";
    font-size: 0.85rem; /* VR-FRIENDLY: Increased from 0.7rem */
    font-style: italic;
    text-transform: none;
}

.param-section label {
    display: block;
    margin-bottom: 0.5rem; /* VR-FRIENDLY: Increased spacing */
    font-weight: 600; /* VR-FRIENDLY: Bolder for better visibility */
    font-size: 1.1rem; /* VR-FRIENDLY: Increased from 0.9rem for VR */
    word-wrap: break-word;
}

.param-section input[type="range"],
.param-section input[type="number"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0.5rem 0;
    font-size: 1.1rem; /* VR-FRIENDLY: Larger input text */
    padding: 0.5rem; /* VR-FRIENDLY: More padding for easier interaction */
}

.param-section input[type="text"],
.param-section select {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1.1rem; /* VR-FRIENDLY: Larger text */
}

.param-section input[type="checkbox"] {
    margin-right: 0.5rem;
}

h4 {
    background-color: var(--secondary-teal);
    color: white;
    padding: 0.75rem 1rem;
    margin: 1.5rem -1rem 0.75rem -1rem; /* VR-FRIENDLY: Improved spacing */
    text-transform: uppercase;
    font-weight: 600;
    font-size: 1.2rem; /* VR-FRIENDLY: Increased from 0.95rem for VR readability */
    border-bottom: none;
}

/* Equipment Toggles */
.equipment-toggle {
    padding: 0.5rem;
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    box-sizing: border-box;
    max-width: 100%;
}

.equipment-toggle label {
    word-wrap: break-word;
    display: block;
}

.setup-instructions {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-left: 4px solid var(--secondary-teal);
    font-style: italic;
}

/* Center Panel */
.webgl-placeholder {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.placeholder-note {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Startup Message */
.startup-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 1.2rem;
    color: #666;
}

/* Debrief Placeholder */
.debrief-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.placeholder-content {
    text-align: center;
    max-width: 600px;
    padding: 2rem;
}

.placeholder-content h2 {
    color: #333;
    margin-bottom: 1rem;
}

.placeholder-content ul {
    text-align: left;
    line-height: 1.8;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 400px;
    max-width: 600px;
}

.modal-content.large {
    min-width: 600px;
    max-width: 800px;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.modal-header h3 {
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-confirm,
.btn-cancel {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
}

.btn-confirm {
    background-color: var(--accent-orange);
    color: white;
}

.btn-confirm:hover {
    background-color: #d46e2c;
}

.btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-cancel {
    background-color: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

/* Scenario List */
.scenario-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scenario-item {
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.scenario-item:hover {
    background-color: #f5f5f5;
    border-color: var(--secondary-teal);
}

.scenario-item h4 {
    margin: 0 0 0.5rem 0;
    color: var(--secondary-teal);
    border-bottom: none;
    padding-bottom: 0;
    background-color: transparent;
}

.scenario-item p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: #666;
}

/* Vertical Tab Indicators */
.vertical-tab-indicator {
    display: flex;
    align-items: stretch;
    background-color: var(--dark-gray);
    position: relative;
    height: 100%;
}

.vertical-tab-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.vertical-tab-button {
    flex: 1;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.vertical-tab-button:not(.active) {
    opacity: 0.7;
}

.vertical-tab-button:hover {
    opacity: 1;
}

.vertical-tab-text {
    writing-mode: vertical-lr;
    transform: rotate(180deg);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    padding: 1rem 0;
    text-transform: uppercase;
}

/* Skin Color Swatches */
.skin-color-swatches {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.skin-swatch {
    width: 50px;
    height: 50px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.skin-swatch:hover {
    transform: scale(1.1);
}

.skin-swatch.selected {
    border-color: var(--secondary-teal);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--secondary-teal);
}

/* Radio Button Labels */
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}
