body, html {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

#top-bar {
    background-color: black;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#title {
    font-size: 1.2em;
    font-weight: bold;
}

#controls {
    display: flex;
    align-items: center;
}

#fileTypeDisplay {
    margin-right: 20px;
}

#viewMode {
    margin-right: 15px;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid #555;
    background: #333;
    color: white;
    cursor: pointer;
}

#validationMark {
    margin-right: 10px;
}

/* Download dropdown menu */
.download-menu {
    position: relative;
    margin-left: 10px;
}

.download-menu summary {
    background-color: green;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    list-style: none;
    border-radius: 3px;
}

.download-menu summary.disabled {
    background-color: #999;
    cursor: not-allowed;
    pointer-events: none;
}

.download-menu summary::-webkit-details-marker {
    display: none;
}

.download-menu summary::after {
    content: " ▼";
    font-size: 0.7em;
}

.download-menu[open] summary::after {
    content: " ▲";
}

.download-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 100;
    min-width: 100px;
}

.download-options button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    color: #333;
}

.download-options button:hover {
    background-color: #f0f0f0;
}

#main-container {
    display: flex;
    height: calc(100% - 50px); /* 50pxはtop-barの高さ */
}

#editor-container {
    flex: 0 0 50%;
    max-width: 800px;
    min-width: 200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ccc;
}

#preview-container {
    flex: 1;
    min-width: 200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

#editor {
    width: 100%;
    flex-grow: 1;
}

#preview-frame {
    width: 100%;
    height: 100%;
    border: none;
}

#error-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 220, 220, 0.95);
    border-bottom: 1px solid #e0e0e0;
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 10px;
    z-index: 1000;
    max-height: 30%;
    overflow-y: auto;
    display: none;
}

.error-title {
    font-size: 16px;
    font-weight: bold;
    color: #d32f2f;
    margin-bottom: 10px;
}

.error-message {
    color: #333;
    margin-bottom: 5px;
}

.error-location {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}
