body {
    font-family: Arial, sans-serif;
    padding: 20px;
    background: #f5f5f5;
}

.container {
    max-width: 1500px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 5% auto auto;
}

.validation-page {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    justify-content: center;
    max-width: 1840px;
    margin: 5% auto auto;
    padding: 0 20px;
}

.validation-page .container {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.validation-page.has-errors .container {
    max-width: 1500px;
}

.validator-footnote {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.error-panel {
    flex: 0 0 clamp(370px, 32vw, 520px);
    width: clamp(370px, 32vw, 520px);
    height: min(86vh, 820px);
    min-height: 420px;
    position: sticky;
    top: 20px;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.error-panel .result.error {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border: none;
    background: transparent;
    padding: 0;
}

.error-panel .error-list {
    overflow-y: auto;
    min-height: 0;
    flex: 1 1 auto;
    padding-right: 4px;
    overscroll-behavior: contain;
}

@media (max-width: 1100px) {
    .validation-page {
        flex-direction: column;
    }
    .error-panel {
        flex: none;
        width: 100%;
        height: auto;
        max-height: 420px;
        position: static;
    }
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.section {
    display: flex;
    flex-direction: column;
}

.section h2 {
    margin-bottom: 15px;
    color: #555;
    font-size: 18px;
}

.file-input {
    margin-bottom: 15px;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #fafafa;
}

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

textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    resize: vertical;
}

#yaml_content {
    flex: 1;
    min-height: 350px;
}

#schema_content {
    height: 100%;
    min-height: 450px;
}

textarea:read-only {
    background: #f9f9f9;
    color: #666;
}

.button-container {
    text-align: center;
    margin: 20px 0;
}

button {
    padding: 12px 40px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background: #5568d3;
}

.result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 4px;
}

.result.success {
    color: #155724;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.result.error {
    color: #721c24;
    background: #fff8f8;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.result h3 {
    margin-bottom: 10px;
}

.result ul {
    margin-left: 20px;
}

.result li {
    margin: 5px 0;
}

input[type="file"] {
    padding: 8px;
}

.editor-wrapper {
    position: relative;
    display: flex;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #f8fafc;
}

.line-numbers {
    padding: 10px 8px 10px 10px;
    background: #eef1f5;
    color: #8996a8;
    text-align: right;
    user-select: none;
    min-width: 42px;
    border-right: 1px solid #d0d7de;
    overflow: hidden;
    white-space: pre;
    pointer-events: none;
    line-height: 1.6;
}

.line-numbers .ln-error {
    color: #c0392b;
    font-weight: 700;
    background: #fdecea;
    display: block;
    margin: 0 -8px 0 -10px;
    padding: 0 8px 0 10px;
}

.line-numbers .ln-active {
    color: #e67e22;
    font-weight: 900;
    background: #fef5e7;
    display: block;
    margin: 0 -8px 0 -10px;
    padding: 0 8px 0 10px;
}

.yaml-editor {
    flex: 1;
    resize: none;
    border: none;
    outline: none;
    padding: 10px 12px;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.6;
    color: #1e2a38;
    white-space: pre;
    overflow: auto;
    tab-size: 2;
    position: relative;
    z-index: 1;
}

.yaml-line-highlight {
    position: absolute;
    left: 42px;
    right: 0;
    height: 0;
    background: rgba(243, 156, 18, 0.25);
    border-left: 3px solid #f39c12;
    pointer-events: none;
    z-index: 0;
    transition: top 0.15s ease, height 0.15s ease;
    display: none;
}

.yaml-line-highlight.active {
    display: block;
}

.yaml-line-highlight.missing {
    background: rgba(231, 76, 60, 0.12);
    border-left: 3px dashed #e74c3c;
}

.error-item {
    background: #fff;
    border: 1px solid #f5c2c7;
    border-left: 4px solid #e74c3c;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.error-item:hover {
    border-left-color: #c0392b;
    box-shadow: 0 2px 12px rgba(192, 57, 43, 0.15);
    transform: translateX(2px);
}

.error-item:focus-visible {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
    border-left-color: #c0392b;
}

.error-item.active-error-card {
    border-left-color: #c0392b;
    background: #fff5f5;
    box-shadow: 0 3px 16px rgba(192, 57, 43, 0.2);
}

.error-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.error-line-badge {
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.error-path {
    font-size: 12px;
    color: #7b8794;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: #f1f3f5;
    padding: 2px 8px;
    border-radius: 4px;
    word-break: break-all;
}

.error-message {
    font-size: 14px;
    font-weight: 600;
    color: #c0392b;
    margin-bottom: 8px;
    line-height: 1.5;
}

.error-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.error-detail-chip {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
}

.error-detail-chip .chip-label {
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.error-detail-chip .chip-value {
    color: #212529;
    word-break: break-word;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.click-hint {
    font-size: 11px;
    color: #aab4be;
    position: absolute;
    right: 14px;
    top: 14px;
}

.error-count-header {
    font-size: 16px;
    font-weight: 700;
    color: #c0392b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jump-to-line-note {
    font-size: 12px;
    color: #7b8794;
    background: #f1f3f5;
    padding: 6px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
}

#schema_content {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#schema_content::selection {
    background: #e74c3c;
    color: #ffffff;
}

#schema_content::-moz-selection {
    background: #e74c3c;
    color: #ffffff;
}
