@font-face {
    font-family: 'TitleFont';
    src: url('title-font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --accent: #9333ea;
    --accent-hover: #7e22ce;
}

.light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --accent: #9333ea;
    --accent-hover: #7e22ce;
}

* {
    border-color: var(--accent);
    font-family: 'TitleFont', sans-serif;
    -webkit-tap-highlight-color: rgba(147, 51, 234, 0.3);
}

html {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    min-width: 900px;
    overflow-x: auto;
}

.app-title {
    color: var(--text-primary);
    font-family: 'TitleFont', sans-serif;
    font-size: 12px;
}

#code-editor {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    border: none;
    padding: 1rem;
    width: 100%;
    height: 100%;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pan-x;
}

#mermaid-output {
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 2rem;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
}

.control-panel {
    background-color: var(--bg-secondary);
    border-top: 1px dashed var(--accent);
    min-width: 900px;
    overflow-x: auto;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    height: 40px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    touch-action: manipulation;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.input-field {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px dashed var(--accent);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    width: 80px;
    height: 40px;
    min-height: 44px;
    font-size: 12px;
    line-height: 1.5;
    box-sizing: border-box;
    vertical-align: middle;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

select.input-field {
    width: 100px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239333ea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px;
    font-size: 12px;
    padding-right: 2rem;
}

label {
    font-size: 12px;
}

button {
    font-size: 12px !important;
}

span {
    font-size: 12px;
}

.pane {
    height: calc(100vh - 120px);
    min-height: 400px;
}

.min-h-screen {
    min-width: 900px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--accent);
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

header {
    background-color: var(--bg-secondary);
    border-bottom: 1px dashed var(--accent);
}

.left-pane {
    border-color: var(--accent);
    border-style: dashed;
}

footer {
    background-color: var(--bg-secondary);
    border-top: 1px dashed var(--accent);
    font-family: 'TitleFont', sans-serif;
    font-size: 12px;
}

.footer-text {
    color: var(--text-secondary);
}

a.credit-link {
    color: #dea4fe;
}

.error-message {
    color: #ef4444;
    padding: 1rem;
}

