* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    background: #f2f6fc;
    color: #1a2336;
    height: 100vh;
    overflow: hidden;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #d9e2f0;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-left h1 {
    font-size: 20px;
    color: #3373f5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-toggle {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.mode-btn {
    padding: 6px 12px;
    border: 1px solid #d9e2f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mode-btn.active {
    background: #3373f5;
    color: white;
    border-color: #3373f5;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d9e2f0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.btn:hover {
    background: #f7faff;
    border-color: #3373f5;
}

.btn-primary {
    background: #3373f5;
    color: white;
    border-color: #3373f5;
}

.btn-primary:hover {
    background: #2a62d4;
}

.history {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid #d9e2f0;
}

/* Main layout */
.main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.panel {
    width: 300px;
    background: white;
    border-right: 1px solid #d9e2f0;
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.right-panel {
    border-right: none;
    border-left: 1px solid #d9e2f0;
}

.panel h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1a2336;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    margin-bottom: 16px;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9e2f0;
    border-radius: 6px;
    font-size: 14px;
}

.scenario-list, .action-list {
    list-style: none;
    margin-bottom: 20px;
}

.scenario-list li, .action-list li {
    padding: 12px;
    border: 1px solid #d9e2f0;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scenario-list li:hover, .action-list li:hover {
    background: #f7faff;
    border-color: #3373f5;
}

.scenario-list li.active, .action-list li.active {
    background: #eaf1ff;
    border-color: #3373f5;
    color: #3373f5;
}

.current-scenario {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #d9e2f0;
}

.steps-list {
    margin-top: 12px;
    padding-left: 20px;
}

.steps-list li {
    margin-bottom: 6px;
    padding: 6px;
    border-radius: 4px;
}

.steps-list li.current {
    background: #eaf1ff;
    color: #3373f5;
    font-weight: 500;
}

/* Center panel */
.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.screen-header {
    margin-bottom: 20px;
}

.screen-header h2 {
    font-size: 24px;
    color: #1a2336;
}

.screen-meta {
    color: #69768f;
    font-size: 14px;
    margin-top: 6px;
}

.screen-container {
    flex: 1;
    position: relative;
    background: #f9fbff;
    border-radius: 12px;
    border: 1px solid #d9e2f0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#screenImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hotspot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hotspot {
    position: absolute;
    border: 2px solid #3373f5;
    background: rgba(51, 115, 245, 0.1);
    border-radius: 6px;
    pointer-events: auto;
    cursor: pointer;
    transition: background 0.2s;
}

.hotspot:hover {
    background: rgba(51, 115, 245, 0.3);
}

.screen-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Action details */
.action-details {
    margin-top: 24px;
    padding: 16px;
    background: #f7faff;
    border-radius: 8px;
    border: 1px solid #d9e2f0;
}

.detail-row {
    margin-bottom: 8px;
    display: flex;
}

.detail-row strong {
    min-width: 80px;
    color: #69768f;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #d9e2f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #69768f;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #d9e2f0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    border-bottom-color: #3373f5;
    color: #3373f5;
    font-weight: 500;
}

.tab-content {
    flex: 1;
    padding: 20px;
    display: none;
    overflow: auto;
}

.tab-content.active {
    display: block;
}

.json-editor {
    width: 100%;
    height: 400px;
    font-family: monospace;
    font-size: 14px;
    padding: 12px;
    border: 1px solid #d9e2f0;
    border-radius: 6px;
    resize: vertical;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #d9e2f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
