/* Dialogue Editor Styles */
.dialogue-editor-container {
    padding: 20px;
}

.dialogue-editor-canvas {
    position: relative;
    min-height: 600px;
    background-color: #f8f9fa;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 20px;
    overflow: auto;
    transition: all 0.3s ease;
}

/* Node Styles */
.dialogue-node {
    position: absolute;
    width: 300px;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    z-index: 10;
    cursor: move;
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.dialogue-node.dragging {
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    transform: scale(1.02);
    opacity: 0.9;
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f3f5;
    padding: 10px 15px;
    border-bottom: 1px solid #ced4da;
    border-radius: 6px 6px 0 0;
    user-select: none;
}

.node-title {
    font-weight: bold;
    font-size: 14px;
    color: #495057;
}

.node-content {
    padding: 15px;
}

/* Connection Lines */
.connection-line {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.connection-line path {
    transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.connection-line:hover path {
    stroke: #007bff !important;
    stroke-width: 3px !important;
}

/* Choice Styles */
.choice-item {
    position: relative;
    border-left: 3px solid #6c757d;
    padding-left: 10px;
    margin-bottom: 12px;
    transition: border-color 0.3s ease;
}

.choice-item:hover {
    border-left-color: #007bff;
}

.effect-details {
    margin-top: 5px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 2px solid #17a2b8;
}

/* Buttons */
.btn-add-choice {
    width: 100%;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.btn-delete-node {
    opacity: 0.7;
    transition: all 0.3s ease;
}

.btn-delete-node:hover {
    opacity: 1;
    transform: scale(1.1);
}

.btn-delete-choice {
    opacity: 0.7;
    transition: all 0.3s ease;
}

.btn-delete-choice:hover {
    opacity: 1;
    background-color: #dc3545;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dialogue-node {
        width: 260px;
    }
    
    .dialogue-editor-canvas {
        min-height: 500px;
    }
}

/* Highlight for active connections */
.node-connection-active {
    stroke: #007bff;
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 2px rgba(0, 123, 255, 0.5));
}

/* Hover states */
.dialogue-node:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-add-choice:hover {
    background-color: #5a6268;
    color: white;
    transform: translateY(-1px);
}

/* JSON output area */
#json-output {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dialogue-node {
    animation: fadeIn 0.3s ease-out;
}

/* Help panel */
.card {
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.card-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Custom form controls */
.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.node-speaker, .node-dialogue {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

[data-tooltip]:hover:after {
    opacity: 1;
    bottom: calc(100% + 5px);
} 

/* Base Styles */
:root {
    --bg-base: #1e1e2e;
    --bg-surface: #1f1d2e;
    --bg-overlay: #2a273f;
    --bg-highlight: #393552;
    
    --text-primary: #e0def4;
    --text-secondary: #908caa;
    --text-accent: #c4a7e7;
    
    --accent-purple: #c4a7e7;
    --accent-blue: #9ccfd8;
    --accent-pink: #eb6f92;
    --accent-orange: #f6c177;
    --accent-green: #31748f;
    --accent-red: #eb6f92;
    
    --border-subtle: #2a273f;
    --border-highlight: #6e6a86;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--accent-purple);
    font-weight: 600;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-purple);
}

/* Buttons */
.btn, button {
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--accent-purple);
    color: var(--bg-base);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--accent-blue);
}

.btn-secondary {
    background-color: var(--bg-highlight);
    color: var(--text-primary);
    border: 1px solid var(--border-highlight);
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--border-highlight);
}

/* Form Controls */
input, textarea, select {
    background-color: var(--bg-overlay);
    border: 1px solid var(--border-highlight);
    color: var(--text-primary);
    padding: 0.6rem;
    border-radius: 4px;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-purple);
}

label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--accent-blue);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col {
    padding: 0.5rem;
    flex: 1;
}

/* Cards */
.card {
    background-color: var(--bg-overlay);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card-header {
    background-color: var(--bg-highlight);
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.card-body {
    padding: 1rem;
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-subtle);
    background-color: var(--bg-surface);
}

/* Utilities */
.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }

/* Dialogue Editor Specific */
.dialogue-node {
    position: absolute;
    background-color: var(--bg-overlay);
    border: 1px solid var(--border-highlight);
    border-radius: 6px;
    width: 250px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 10;
}

.node-header {
    background-color: var(--bg-highlight);
    padding: 0.6rem;
    cursor: move;
    display: flex;
    justify-content: space-between;
}

.node-body {
    padding: 0.8rem;
}

.node-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 0.5rem;
}

.connector {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: var(--accent-orange);
    border-radius: 50%;
    cursor: pointer;
}

.connector:hover {
    transform: scale(1.2);
}

/* Dialogue canvas */
.canvas-container {
    position: relative;
    overflow: auto;
    width: 100%;
    height: calc(100vh - 150px);
}

.dialogue-canvas {
    width: 3000px;
    height: 3000px;
    position: relative;
    background-color: var(--bg-base);
    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: 25px 25px;
}

/* Node Editor */
.node-editor {
    width: 350px;
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    height: 100%;
    overflow-y: auto;
}

/* Animation */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 6px;
    background-color: var(--accent-blue);
    color: var(--bg-base);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out forwards;
    max-width: 300px;
}

.notification.error {
    background-color: var(--accent-red);
}

.notification.success {
    background-color: var(--accent-green);
}

/* Responsive */
@media (max-width: 768px) {
    .editor-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
    
    .node-editor-container {
        width: 100%;
    }
}

/* Add styles for direct connections */
.direct-connection {
    display: flex;
    align-items: center;
    margin-top: 8px;
    padding: 4px 8px;
    background-color: #f0f8ff;
    border-radius: 4px;
    border: 1px dashed #a0c0e0;
}

.direct-connection.hidden {
    display: none;
}

.direct-connection span {
    margin-right: 4px;
    font-size: 13px;
    color: #585858;
}

.direct-next-node {
    font-weight: 500;
    color: #0066cc;
}

/* Speaker selection styling */
.speaker-selection {
    position: relative;
    width: 100%;
}

/* Improve form element spacing */
.form-group {
    margin-bottom: 15px;
}

.form-text.text-muted {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* Connection line styling */
.connection-line.direct-connection {
    stroke: #4a90e2;
    stroke-dasharray: 5,5;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: 1000;
    }
} 