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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #fafbfc;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #24292f;
}

.container {
    flex: 1;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.left-panel {
    width: 400px;
    min-width: 300px;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid #d1d9e0;
    position: relative;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #d1d9e0;
    cursor: col-resize;
    transition: all 0.2s ease;
}

.resize-handle:hover {
    background: hsla(200, 100%, 50%, 1.0);
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    position: relative;
}

.panel-header {
    background: #f6f8fa;
    color: #24292f;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #d1d9e0;
    letter-spacing: 0.025em;
}

.right-panel .panel-header {
    display: none;
}

.code-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#mermaidCode {
    flex: 1;
    border: none;
    padding: 20px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: #ffffff;
    color: #24292f;
}

.chart-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    background-image: 
        radial-gradient(circle, #e1e4e8 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    color: #24292f;
    transition: all 0.2s ease;
}

.zoom-btn svg {
    width: 18px;
    height: 18px;
}

.zoom-btn:hover {
    background: #f6f8fa;
    color: hsla(200, 100%, 50%, 1.0);
    border-color: hsla(200, 100%, 50%, 1.0);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#mermaidOutput {
    transform-origin: 0 0;
    transition: transform 0.2s ease;
    cursor: grab;
}

#mermaidOutput:active {
    cursor: grabbing;
}

#mermaidOutput svg {
    display: block;
}

.controls {
    padding: 16px 20px;
    background: #f6f8fa;
    border-top: 1px solid #d1d9e0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: hsla(200, 100%, 50%, 1.0);
    color: white;
    border-color: hsla(200, 100%, 50%, 1.0);
}

.btn-primary:hover {
    background: hsla(200, 100%, 45%, 1.0);
    border-color: hsla(200, 100%, 40%, 1.0);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(9, 105, 218, 0.3);
}

.btn-secondary {
    background: #ffffff;
    color: #24292f;
    border-color: #d1d9e0;
}

.btn-secondary:hover {
    background: #f6f8fa;
    color: hsla(200, 100%, 50%, 1.0);
    border-color: hsla(200, 100%, 50%, 1.0);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.error-message {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    padding: 16px;
    border-radius: 8px;
    margin: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.examples {
    padding: 16px 20px;
    background: #f6f8fa;
    border-top: 1px solid #d1d9e0;
}

.examples {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.examples h3 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #656d76;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
}

.example-btn {
    display: inline-block;
    padding: 6px 12px;
    background: #ffffff;
    color: #24292f;
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.example-btn:hover {
    background: #f6f8fa;
    border-color: hsla(200, 100%, 50%, 1.0);
    color: hsla(200, 100%, 50%, 1.0);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.example-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.loading {
    display: none;
    color: #656d76;
    font-size: 13px;
    margin-left: 12px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        min-width: auto;
        max-width: none;
        height: 300px;
    }
    
    .resize-handle {
        display: none;
    }
}