* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: #1e1e1e;
    color: #d4d4d4;
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
    gap: 10px;
}

/* 言語切替ボタン */
.language-switcher {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 10px;
    background-color: #252526;
    border-radius: 4px;
    border: 1px solid #3e3e42;
}

.lang-btn {
    background-color: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    padding: 8px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    transition: all 0.2s;
}

.lang-btn:hover {
    background-color: #4e4e50;
}

.lang-btn.active {
    background-color: #007acc;
    border-color: #007acc;
    color: #ffffff;
    font-weight: bold;
}

/* 上段：Input / Controls（固定高さ） */
.input-section {
    background-color: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coverage-banner {
    background-color: #2d2d30;
    padding: 8px 12px;
    border-left: 3px solid #007acc;
    font-size: 0.9em;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.supported {
    color: #4ec9b0;
}

.unsupported {
    color: #dcdcaa;
}

.fallback-note {
    color: #9cdcfe;
    font-style: italic;
}

.example-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background-color: #2d2d30;
    border-radius: 3px;
}

.selector-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.example-selector label {
    color: #9cdcfe;
    font-size: 0.9em;
    min-width: 100px;
}

.example-selector select {
    flex: 1;
    background-color: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.example-selector select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#load-example-btn {
    background-color: #0e639c;
    color: #ffffff;
    border: none;
    padding: 6px 16px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

#load-example-btn:hover:not(:disabled) {
    background-color: #1177bb;
}

#load-example-btn:disabled {
    background-color: #3e3e42;
    opacity: 0.5;
    cursor: not-allowed;
}

.demo-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.demo-btn {
    background-color: #2d2d30;
    color: #9cdcfe;
    border: 1px solid #3e3e42;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s;
}

.demo-btn:hover {
    background-color: #3c3c3c;
    border-color: #007acc;
    color: #ffffff;
}

.demo-btn:active {
    background-color: #007acc;
}

#input-text {
    width: 100%;
    min-height: 60px;
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    padding: 10px;
    font-family: inherit;
    font-size: 0.95em;
    resize: vertical;
    border-radius: 3px;
}

#input-text::placeholder {
    color: #6a737d;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.left-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.main-controls, .secondary-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.primary-btn {
    background-color: #0e639c;
    color: #ffffff;
    border: none;
    padding: 8px 24px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.2s;
}

.primary-btn:hover {
    background-color: #1177bb;
}

.primary-btn:disabled {
    background-color: #3e3e42;
    cursor: not-allowed;
}

#log-level {
    background-color: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    padding: 6px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.secondary-controls button {
    background-color: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 0.85em;
    transition: background-color 0.2s;
}

.secondary-controls button:hover {
    background-color: #505050;
}

.status-info {
    display: flex;
    gap: 15px;
    font-size: 0.8em;
    color: #858585;    white-space: nowrap;
}

#request-id {
    font-family: 'Courier New', monospace;
    max-width: none; /* 幅制限なし */}

/* 中段：Structured Output（可変高さ） */
.output-section {
    background-color: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.output-section h2 {
    font-size: 1em;
    color: #4ec9b0;
    margin-bottom: 10px;
    font-weight: normal;
}

.output-text {
    flex: 1;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    padding: 15px;
    overflow-y: auto;
    font-size: 0.9em;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 下段：Live Analysis Log（固定高さ） */
.log-section {
    background-color: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 15px;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.log-section h2 {
    font-size: 1em;
    color: #4ec9b0;
    margin-bottom: 10px;
    font-weight: normal;
}

.log-container {
    flex: 1;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    padding: 10px;
    overflow-y: auto;
    font-size: 0.85em;
    line-height: 1.4;
}

.log-entry {
    margin-bottom: 2px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.log-entry.INFO {
    color: #d4d4d4;
}

.log-entry.DEBUG {
    color: #9cdcfe;
}

.log-entry.TRACE {
    color: #6a9955;
}

.log-entry.WARN {
    color: #dcdcaa;
}

.log-entry.ERROR {
    color: #f48771;
}

.log-timestamp {
    color: #858585;
}

.log-level {
    font-weight: bold;
    margin: 0 6px;
}

.log-stage {
    color: #4ec9b0;
}

/* Spinner Animation */
.spinner {
    border: 4px solid #3e3e42;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* スクロールバー */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}
