/* Dialogue Editor View Styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1e1e2e;
    color: #e0def4;
    height: 100vh;
    overflow: hidden;
}

.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.editor-header {
    background-color: #191724;
    padding: 1rem;
    border-bottom: 1px solid #2a273f;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-title h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #c4a7e7;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.action-button {
    padding: 0.5rem 1rem;
    background-color: #c4a7e7;
    color: #191724;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.action-button.secondary {
    background-color: #2a273f;
    color: #e0def4;
}

.secondary-button {
    padding: 0.4rem 0.8rem;
    background-color: #2a273f;
    color: #e0def4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.secondary-button-sm {
    padding: 0.3rem 0.6rem;
    background-color: #2a273f;
    color: #e0def4;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Button with conditions or effects */
.secondary-button-sm.has-conditions,
.secondary-button-sm.has-effects {
    background-color: #9ccfd8;
    color: #191724;
}

.icon-button {
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: 1px solid #6e6a86;
    color: #e0def4;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-button:hover {
    background-color: #6e6a86;
    color: #e0def4;
}

.editor-content {
    display: flex;
    flex-grow: 1;
    height: calc(100vh - 70px);
    overflow: hidden;
}

.sidebar {
    width: 450px;
    background-color: #1f1d2e;
    border-right: 1px solid #2a273f;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 10px;
}

.panel {
    border-bottom: 1px solid #2a273f;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel-header {
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a273f;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.panel-header:hover {
    background-color: #393552;
}

.panel-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #9ccfd8;
    transition: color 0.2s ease;
}

.panel-toggle:hover h3 {
    color: #c4a7e7;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.panel-content {
    padding: 1rem;
    max-height: 350px;
    overflow-y: auto;
    background-color: #1f1d2e;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.panel.collapsed .panel-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.panel.collapsed .toggle-panel i {
    transform: rotate(-90deg);
}

.toggle-panel i {
    transition: transform 0.3s ease;
}

.node-item {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background-color: #2a273f;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-item:hover {
    background-color: #393552;
}

.node-item-speaker {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ebbcba;
    margin-bottom: 0.2rem;
}

.node-item-text {
    font-size: 0.8rem;
    color: #908caa;
}

.variable-item {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    background-color: #2a273f;
    border-radius: 4px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "name actions"
        "type actions"
        "value actions";
    gap: 0.3rem;
}

.variable-name {
    grid-area: name;
    font-weight: 600;
    color: #ebbcba;
    font-size: 0.9rem;
}

.variable-type {
    grid-area: type;
    color: #9ccfd8;
    font-size: 0.8rem;
}

.variable-value {
    grid-area: value;
    color: #c4a7e7;
    font-size: 0.8rem;
    font-style: italic;
}

.variable-actions {
    grid-area: actions;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.editor-main {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    display: flex;
}

.canvas-container {
    flex-grow: 1;
    position: relative;
    overflow: auto;
}

.dialogue-canvas {
    width: 3000px;
    height: 2000px;
    position: relative;
    background-color: #191724;
    background-image: 
        linear-gradient(rgba(110, 106, 134, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 106, 134, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.dialogue-node {
    position: absolute;
    width: 280px;
    background-color: #2a273f;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    border: 1px solid #393552;
}

.dialogue-node:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.node-header {
    background-color: #393552;
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-bottom: 2px solid #6e6a86;
}

.node-speaker {
    font-weight: 600;
    font-size: 1rem;
    color: #ebbcba;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.node-actions {
    display: flex;
    gap: 0.4rem;
}

.node-btn {
    width: 28px;
    height: 28px;
    background-color: rgba(0, 0, 0, 0.2);
    border: none;
    color: #e0def4;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.node-btn:hover {
    background-color: rgba(196, 167, 231, 0.3);
    color: #c4a7e7;
}

.node-body {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.1);
}

.node-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e0def4;
}

.node-footer {
    padding: 0.8rem;
    border-top: 1px solid #393552;
    background-color: rgba(0, 0, 0, 0.05);
}

.node-choice {
    background-color: #393552;
    padding: 0.7rem;
    margin-bottom: 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #9ccfd8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border-left: 3px solid #9ccfd8;
}

.node-choice:hover {
    background-color: #6e6a86;
    transform: translateX(3px);
}

.choice-connector {
    width: 14px;
    height: 14px;
    background-color: #f6c177;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(246, 193, 119, 0.5);
    transition: all 0.2s ease;
}

.node-choice:hover .choice-connector {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(246, 193, 119, 0.7);
}

.node-editor-container {
    width: 350px;
    background-color: #1f1d2e;
    border-left: 1px solid #2a273f;
    overflow-y: auto;
    transition: width 0.3s ease;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.node-editor-container.expanded {
    width: 500px;
}

.node-editor-header {
    padding: 1rem;
    border-bottom: 1px solid #2a273f;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a273f;
}

.node-editor-header h3 {
    margin: 0;
    color: #c4a7e7;
}

.node-editor-actions {
    display: flex;
    gap: 0.5rem;
}

.node-editor-content {
    padding: 1rem;
}

.editor-section {
    margin-bottom: 1.5rem;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #2a273f;
    background-color: #26233a;
}

.section-header {
    padding: 0.8rem 1rem;
    background-color: #2a273f;
    cursor: pointer;
}

.section-header h4 {
    margin: 0;
    color: #9ccfd8;
    font-size: 0.95rem;
}

.section-content {
    padding: 1rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.editor-section.collapsed .section-content {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    color: #9ccfd8;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    background-color: #1f1d2e;
    border: 1px solid #393552;
    border-radius: 4px;
    color: #e0def4;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: #c4a7e7;
    box-shadow: 0 0 0 2px rgba(196, 167, 231, 0.25);
    outline: none;
}

.choice-item {
    background-color: #2a273f;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #393552;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.choice-item:hover {
    border-color: #c4a7e7;
    transform: translateY(-2px);
}

.choice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.choice-header h4 {
    margin: 0;
    color: #ebbcba;
    font-size: 0.9rem;
}

.conditions-effects {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.hidden {
    display: none;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 6px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out forwards;
}

.notification.success {
    background-color: #9ccfd8;
    color: #191724;
}

.notification.error {
    background-color: #eb6f92;
    color: #191724;
}

@keyframes slideIn {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #1f1d2e;
    border: 1px solid #2a273f;
    border-radius: 4px;
    width: 150px;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: #e0def4;
    text-decoration: none;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #2a273f;
}

/* Modal styles for condition and effect dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
    backdrop-filter: blur(3px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    width: 550px;
    max-width: 90%;
    background-color: #1f1d2e;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    animation: slideUp 0.3s ease-out;
    border: 1px solid #393552;
    overflow: hidden;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content {
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.2rem;
    border-bottom: 1px solid #2a273f;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a273f;
}

.modal-title {
    margin: 0;
    color: #c4a7e7;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: #e0def4;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #eb6f92;
}

.modal-body {
    padding: 1.5rem;
    max-height: 65vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.2rem;
    border-top: 1px solid #2a273f;
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    background-color: rgba(0, 0, 0, 0.1);
}

.condition-item, .effect-item {
    background-color: #2a273f;
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    position: relative;
    border: 1px solid #393552;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.condition-item:hover, .effect-item:hover {
    transform: translateY(-2px);
    border-color: #c4a7e7;
}

.delete-condition-btn, .delete-effect-btn {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background-color: rgba(235, 111, 146, 0.2);
    transition: background-color 0.2s ease;
}

.delete-condition-btn:hover, .delete-effect-btn:hover {
    background-color: rgba(235, 111, 146, 0.4);
}

.conditions-list, .effects-list {
    margin-bottom: 1.5rem;
}

.add-condition-btn, .add-effect-btn {
    margin-bottom: 1rem;
    background-color: #393552;
    color: #9ccfd8;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.add-condition-btn:hover, .add-effect-btn:hover {
    background-color: #6e6a86;
}

/* Global Conditions Styles */
.global-condition-item {
    background-color: #2a273f;
    border-radius: 6px;
    padding: 0.8rem;
    margin-bottom: 0.8rem;
    border-left: 3px solid #9ccfd8;
    transition: all 0.2s ease;
}

.global-condition-item:hover {
    background-color: #393552;
    transform: translateX(3px);
    border-left-color: #c4a7e7;
}

.global-condition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.global-condition-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #e0def4;
}

.global-condition-actions {
    display: flex;
    gap: 0.3rem;
}

.global-condition-actions .icon-button {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
}

.global-condition-details {
    font-size: 0.8rem;
    color: #908caa;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.condition-variable {
    color: #9ccfd8;
    font-weight: 500;
}

.condition-operator {
    color: #c4a7e7;
}

.condition-value {
    color: #f6c177;
}

.condition-type {
    color: #908caa;
    font-style: italic;
    margin-left: auto;
}

.use-condition:hover {
    background-color: rgba(156, 207, 216, 0.3);
    color: #9ccfd8;
} 