/* Editor Layout */

/* Help Toggle */
.help-toggle {
    background: none;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 0.5rem;
    padding: 0.2rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.help-toggle:hover {
    opacity: 1;
    background: var(--bg-tertiary);
}

/* Node Help Section */
.node-help {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    animation: slideDown 0.3s ease;
}

.node-help.hidden {
    display: none;
}

.node-help h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.help-item {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 4px;
    border-left: 3px solid var(--accent-color);
    font-size: 0.875rem;
    line-height: 1.4;
}

.help-item:last-child {
    margin-bottom: 0;
}

.help-item strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Provider Section */
.provider-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.provider-section label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.provider-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    min-width: 120px;
}

.provider-select option {
    background: var(--secondary-color);
    color: white;
}

/* AI Button */
.ai-btn {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ai-btn:hover {
    background: linear-gradient(45deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-1px);
}

/* Story Generation Modal */
.form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
    resize: vertical;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-help {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    line-height: 1.3;
}

.form-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.btn-loading {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn-text.hidden,
.btn-loading.hidden {
    display: none;
}
#editor-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

#editor-header {
    background: var(--secondary-color);
    color: var(--text-inverse);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.story-name-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 1.1rem;
}

.story-name-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.header-controls {
    display: flex;
    gap: 0.5rem;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.header-btn.success {
    background: var(--success-color);
    border-color: var(--success-color);
}

/* Main Editor Layout */
#editor-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

#editor-sidebar {
    width: 250px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color, var(--border-color));
    overflow-y: auto;
}

.tool-section {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color, var(--border-color));
}

.tool-section h3 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-section h3::before {
    content: '';
    font-size: 1.2rem;
}

/* Story Stats */
.story-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color, var(--border-color));
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Node Palette */
.node-palette {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.palette-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color, var(--border-color));
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.palette-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.palette-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.node-icon {
    font-size: 1.5rem;
}

.tool-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tool-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.tool-btn::before {
    content: '+';
    font-size: 1.1rem;
    font-weight: bold;
}

/* Canvas Area */
#editor-canvas-container {
    flex: 1;
    position: relative;
    background: #f8f8f8;
    overflow: hidden;
}

#editor-toolbar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    z-index: 100;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
}

.toolbar-btn:hover {
    background: var(--bg-tertiary);
}

#editor-canvas {
    cursor: grab;
}

#editor-canvas.panning {
    cursor: grabbing;
}

.canvas-bg {
    fill: #f8f8f8;
}

/* Story Nodes */
.story-node {
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.story-node.selected {
    filter: drop-shadow(0 0 0 3px var(--primary-color));
}

.story-node.dragging {
    opacity: 0.7;
    cursor: grabbing;
}

.node-rect {
    fill: white;
    stroke: var(--border-color);
    stroke-width: 2;
    rx: 8;
}

.node-header {
    fill: var(--primary-color);
}

.node-type-choice .node-header {
    fill: var(--warning-color);
}

.node-type-condition .node-header {
    fill: var(--secondary-color);
}

.node-type-event .node-header {
    fill: var(--success-color);
}

.node-type-ending .node-header {
    fill: var(--danger-color);
}

.node-type-keystone .node-header {
    fill: #9b59b6; /* Purple for keystone */
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.node-type-keystone .node-rect {
    stroke: #8e44ad;
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(155, 89, 182, 0.4));
}

.node-type-keystone.selected .node-rect {
    filter: drop-shadow(0 0 12px rgba(155, 89, 182, 0.8));
}

.node-title {
    fill: white;
    font-weight: bold;
    font-size: 12px;
}

.node-text {
    fill: var(--text-primary);
    font-size: 10px;
}

.node-port {
    fill: var(--primary-color);
    stroke: white;
    stroke-width: 2;
    cursor: crosshair;
}

.node-port:hover {
    r: 8;
}

/* Connections */
.connection {
    stroke: #999;
    stroke-width: 2;
    fill: none;
    pointer-events: stroke;
    cursor: pointer;
}

.connection:hover {
    stroke: var(--primary-color);
    stroke-width: 3;
}

.connection.conditional {
    stroke-dasharray: 5, 5;
}

.connection-arrow {
    fill: #999;
}

.temp-connection {
    stroke: var(--primary-color);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 5, 5;
    pointer-events: none;
}

/* Properties Panel */
#properties-panel {
    width: 300px;
    background: var(--bg-tertiary);
    border-left: 1px solid var(--border-color, var(--border-color));
    padding: 1rem;
    overflow-y: auto;
}

#properties-panel h3 {
    margin-bottom: 1rem;
}

.property-group {
    margin-bottom: 1.5rem;
}

.property-group h4 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.property-field {
    margin-bottom: 1rem;
}

.property-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.property-input,
.property-select,
.property-textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color, var(--border-color));
    border-radius: 4px;
    background: var(--bg-primary);
}

.property-textarea {
    min-height: 100px;
    resize: vertical;
}

.choices-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.choice-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.choice-item input {
    flex: 1;
}

.choice-item button {
    padding: 0.25rem 0.5rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Condition List */
.condition-list,
.variable-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.condition-list:empty::after,
.variable-list:empty::after {
    content: 'No conditions created yet';
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg-primary);
    border: 2px dashed var(--border-color, var(--border-color));
    border-radius: 8px;
}

.condition-item,
.variable-item {
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color, var(--border-color));
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.condition-item:hover,
.variable-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.condition-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.condition-item .condition-type {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.condition-item.active .condition-type {
    color: rgba(255, 255, 255, 0.8);
}

.condition-item .condition-expression {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    background: rgba(0,0,0,0.05);
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    word-break: break-all;
}

.condition-item.active .condition-expression {
    background: rgba(255, 255, 255, 0.1);
}

.condition-item .condition-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.condition-item.active .condition-description {
    color: rgba(255, 255, 255, 0.7);
}

/* Condition Builder */
.condition-builder {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.condition-type {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.condition-type label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.condition-type select {
    padding: 0.75rem;
    border: 2px solid var(--border-color, var(--border-color));
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-primary);
    transition: border-color 0.2s ease;
}

.condition-type select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#condition-params {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color, var(--border-color));
}

#condition-params:empty::after {
    content: 'Select a condition type to configure parameters';
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.param-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.param-field label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.param-field input,
.param-field select {
    padding: 0.75rem;
    border: 2px solid var(--border-color, var(--border-color));
    border-radius: 6px;
    font-size: 1rem;
    background: var(--bg-primary);
    transition: border-color 0.2s ease;
}

.param-field input:focus,
.param-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.condition-preview {
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px solid var(--success-color);
}

.condition-preview h4 {
    margin: 0 0 1rem 0;
    color: var(--success-color);
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.condition-preview h4::before {
    content: '👁️';
}

.condition-preview code {
    display: block;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color, var(--border-color));
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-primary);
    word-wrap: break-word;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn:not(.primary) {
    background: var(--neutral-color);
    color: white;
}

.btn:not(.primary):hover {
    opacity: 0.9;
}

/* Modal Overrides */
.modal-content.large {
    max-width: 800px;
    width: 90%;
}

#test-frame {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 4px;
}

/* Empty States */
.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* Media Preview Styles */
.media-preview {
    position: relative;
    margin: 0.5rem 0;
}

.media-preview img,
.media-preview video {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.generation-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: badgeGlow 2s infinite;
}

@keyframes badgeGlow {
    0%, 100% { 
        box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 0 8px rgba(102, 126, 234, 0.3);
    }
    50% { 
        box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 0 16px rgba(102, 126, 234, 0.5);
    }
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.generation-status {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.generation-status.success {
    border-color: var(--success-color);
    background: rgba(46, 204, 113, 0.1);
}

.generation-status.error {
    border-color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
}

.generation-status.loading {
    border-color: var(--primary-color);
    background: rgba(52, 152, 219, 0.1);
}

/* API Connection Status */
.api-status {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.api-status.connected {
    border-color: var(--success-color);
    color: var(--success-color);
}

.api-status.disconnected {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.api-status.connecting {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Responsive */
@media (max-width: 1024px) {
    #editor-sidebar {
        width: 200px;
    }
    
    #properties-panel {
        width: 250px;
    }
}

@media (max-width: 768px) {
    #editor-main {
        flex-direction: column;
    }
    
    #editor-sidebar,
    #properties-panel {
        width: 100%;
        height: 200px;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--border-color, var(--border-color));
    }
}

/* Embedded Player Styles */
.embedded-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: var(--bg-primary);
    border-top: 2px solid var(--accent-color);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transform: translateY(calc(100% - 120px));
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.embedded-player.expanded {
    transform: translateY(0);
}

.player-header {
    background: var(--bg-secondary);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.player-controls h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.story-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 200px;
}

.story-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.player-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.player-iframe-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#story-player-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-primary);
}

.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Adjust main editor when player is expanded */
#editor-app.player-expanded #editor-main {
    height: calc(100vh - 40vh - 60px);
}

/* Responsive embedded player */
@media (max-width: 768px) {
    .embedded-player {
        height: 50vh;
    }
    
    .player-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .story-select {
        min-width: auto;
        width: 100%;
    }
    
    #editor-app.player-expanded #editor-main {
        height: calc(100vh - 50vh - 60px);
    }
}
/* Keyboard shortcut styling */
kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-family: monospace;
    font-size: 0.85em;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    min-width: 2rem;
    text-align: center;
}

/* Help modal table styling */
.modal-content table {
    border-collapse: collapse;
}

.modal-content table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-content table td:first-child {
    width: 30%;
    font-weight: 600;
}

/* Collapsible Sections */
.collapsible .collapsible-header {
    cursor: pointer;
    user-select: none;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
}

.collapsible .collapsible-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.collapsible .toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 0.8em;
    margin-right: 0.5rem;
    width: 1em;
}

.collapsible.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.collapsible .collapsible-content {
    max-height: 2000px;
    overflow: visible;
    transition: max-height 0.3s ease, padding 0.3s;
    padding-top: 0.5rem;
}

.collapsible.collapsed .collapsible-content {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
}

/* Property Group Collapsible */
.property-group.collapsible {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color, var(--border-light));
    border-radius: 6px;
    padding: 0.75rem;
    background: var(--bg-secondary, #f9f9f9);
}

.property-group.collapsible .collapsible-header {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.property-group.collapsible.collapsed {
    background: transparent;
}

/* Tool Section Collapsible */
.tool-section.collapsible {
    border-bottom: 1px solid var(--border-color, var(--border-light));
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.tool-section.collapsible .collapsible-header {
    margin-bottom: 0.75rem;
}

.tool-section.collapsible h3 {
    margin: 0;
    padding: 0;
}
