* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    overflow: hidden;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
}

h1 {
    font-size: 1.5rem;
    color: #569cd6;
}

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

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn.primary {
    background: #0e639c;
    color: white;
}

.btn.primary:hover {
    background: #1177bb;
}

.time-display {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    color: #d4d4d4;
    min-width: 90px;
    text-align: center;
}

.btn:not(.primary) {
    background: #3c3c3c;
    color: #d4d4d4;
}

.btn:not(.primary):hover {
    background: #4c4c4c;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 15px;
}

.volume-control label {
    font-size: 1.1rem;
    color: #d4d4d4;
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: #3c3c3c;
    outline: none;
    border-radius: 2px;
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #0e639c;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #1177bb;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #0e639c;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    background: #1177bb;
}

#volumeValue {
    color: #d4d4d4;
    font-size: 0.85rem;
    min-width: 35px;
    text-align: right;
}

.status {
    color: #4ec9b0;
    font-size: 0.9rem;
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-container {
    flex: 2;
    display: flex;
    flex-direction: column;
}

.CodeMirror {
    height: 100% !important;
    font-size: 14px;
    line-height: 1.5;
}

.output-container {
    flex: 1;
    background: #252526;
    border-left: 1px solid #3e3e42;
    display: flex;
    flex-direction: column;
}

/* Samples Panel */
.samples-panel {
    border-bottom: 1px solid #3e3e42;
    padding: 0.5rem 1rem;
}
.samples-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.samples-header h3 {
    color: #c586c0;
    font-size: 1rem;
}
.dropzone {
    border: 2px dashed #3e3e42;
    border-radius: 6px;
    padding: 0.75rem;
    text-align: center;
    color: #858585;
    background: #1f1f1f;
}
.dropzone.dragover {
    border-color: #569cd6;
    color: #9cdcfe;
}
.samples-list {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow: auto;
}
.sample-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: #2a2a2a;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}
.sample-item:hover { border-color: #569cd6; }
.sample-waveform { flex: 0 0 auto; border-radius: 2px; background: #1e1e1e; }
.sample-meta { display: flex; gap: 10px; align-items: center; }
.sample-name { color: #dcdcaa; }
.sample-len { color: #858585; font-size: 0.85rem; }

/* Sample remove button */
.sample-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    border: 1px solid #3e3e42;
    background: #1f1f1f;
    color: #d4d4d4;
    cursor: pointer;
    opacity: 0;
    transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}
.sample-item:hover .sample-remove { opacity: 1; }
.sample-remove:hover { background: #3a3a3a; color: #fff; }

.console {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #d4d4d4;
}

.console-line {
    margin-bottom: 0.5rem;
}

.console-line.error {
    color: #f48771;
}

.console-line.success {
    color: #4ec9b0;
}

.console-line.info {
    color: #9cdcfe;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
    pointer-events: none;
}
.toast {
    background: #2a2a2a;
    color: #e5e5e5;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    transform: translateY(8px);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: auto;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}

/* Graph Modal Styles */
.graph-modal {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    padding: 0;
    max-width: 95vw;
    max-height: 95vh;
    width: 1200px;
    height: 800px;
    margin: auto;
}

.graph-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    color: #569cd6;
    margin: 0;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    color: #d4d4d4;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background: #424242;
}

.modal-content {
    padding: 1rem;
    height: calc(100% - 60px);
    overflow: auto;
}

.graph-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #252526;
    border-radius: 4px;
    border: 1px solid #3e3e42;
}

.graph-container p {
    color: #858585;
    font-style: italic;
}

/* Mermaid graph styling */
.graph-container svg {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    background: transparent;
}

.graph-container .mermaid {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Editor-only Fullscreen Mode */
body.fullscreen-editor-only header,
body.fullscreen-editor-only .output-container,
body.fullscreen-editor-only .status,
body.fullscreen-editor-only .graph-modal {
    display: none !important;
}

body.fullscreen-editor-only .container,
body.fullscreen-editor-only main,
body.fullscreen-editor-only .editor-container {
    height: 100vh !important;
}

body.fullscreen-editor-only .CodeMirror {
    height: 100vh !important;
}
