body {
    font-family: 'Segoe UI', Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

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

.header {
    background-color: #2c3e50;
    color: white;
    padding: 10px 15px;
    text-align: center;
    flex-shrink: 0;
}

.header a {
    color: white;
    text-decoration: underline;
    font-weight: bold;
}

.header a:hover {
    text-decoration: underline;
}

.converter-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.editor-pane, .preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
    min-height: 0;
    height: 100%;
}

.editor-pane {
    padding-right: 5px;
}

.preview-pane {
    padding-left: 5px;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #34495e;
    color: white;
    padding: 8px 15px;
    border-radius: 4px 4px 0 0;
    flex-shrink: 0;
}

.pane-export-buttons {
    display: flex;
    gap: 6px;
}

.pane-export-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    display: flex;
    align-items: center;
}

.pane-export-btn:hover {
    background: rgba(255,255,255,0.1);
}

.pane-export-btn svg {
    pointer-events: none;
}

.copy-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.1);
}

.editor, .preview-container {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    background-color: white;
    overflow: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

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

.preview-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background-color: #f8f8f8;
    flex-shrink: 0;
    position: relative;
}

.preview-tab {
    padding: 8px 15px;
    cursor: pointer;
    border-right: 1px solid #ddd;
    flex-grow: 1;
    text-align: center;
}

.preview-tab.active {
    background-color: white;
    border-bottom: 2px solid #2c3e50;
    font-weight: bold;
}

.preview-content-container {
    flex: 1;
    overflow: auto;
    position: relative;
}

.preview-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 15px;
    overflow: auto;
    box-sizing: border-box;
    display: none;
}

.preview-content.active {
    display: block;
}

#htmlPreview {
    height: 100%;
}

#htmlSource {
    height: 100%;
    white-space: pre;
    font-family: monospace;
}

.warning-message {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffeeba;
    text-align: center;
    max-width: 80%;
    z-index: 100;
}

.warning-message.show {
    display: block;
}

@media (max-width: 768px) {
    .converter-container {
        flex-direction: column;
    }

    .editor-pane, .preview-pane {
        padding: 10px;
        height: 50%;
    }

    .pane-header {
        padding: 6px 10px;
    }

    .pane-export-buttons {
        gap: 4px;
    }

    .pane-export-btn, .copy-btn {
        padding: 2px 4px;
    }

    .preview-content {
        padding: 10px;
    }

    .CodeMirror-scroll, .preview-content {
        -webkit-overflow-scrolling: touch;
    }
}