/* Agent-engines inspired theme */

/* Base */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
    background: #ecf0f1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
#app-header {
    background: #2c3e50;
    color: #fff;
    padding: 14px 24px;
    border-bottom: 5px solid #9b59b6;
    flex-shrink: 0;
}

#app-header .header-title {
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* App body fills remaining space */
#app-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Tab menu overrides */
.ui.top.attached.tabular.menu {
    background: #fff;
    border-bottom: 2px solid #ddd;
    flex-shrink: 0;
    margin: 0;
    padding-top: 10px;
}

.ui.top.attached.tabular.menu .item {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    padding: 12px 24px;
}

.ui.top.attached.tabular.menu .item.active {
    color: #9b59b6;
    border-color: #9b59b6;
    background: #fff;
    margin-bottom: -2px;
    border-bottom-color: #fff;
}

.ui.top.attached.tabular.menu .item:hover {
    color: #9b59b6;
}

/* Tab content panels */
.ui.bottom.attached.tab.segment {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: none;
    border: none;
    margin: 0;
    padding: 0;
    background: #fff;
}

.ui.bottom.attached.tab.segment.active {
    display: flex;
    flex-direction: column;
}

.tab-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Buttons */
.ui.primary.button,
.ui.purple.button {
    background-color: #9b59b6;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ui.primary.button:hover,
.ui.purple.button:hover {
    background-color: #8e44ad;
    color: #fff;
}

.ui.primary.button:focus,
.ui.purple.button:focus {
    background-color: #8e44ad;
    color: #fff;
}

/* Inputs */
.ui.input input[type="text"],
.ui.form input[type="text"],
.ui.form textarea,
select.ui.dropdown {
    border: 2px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ui.input input[type="text"]:focus,
.ui.form input[type="text"]:focus,
.ui.form textarea:focus {
    border-color: #9b59b6;
    box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.15);
}

/* Tables */
.ui.celled.striped.table thead th {
    background: #2c3e50;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-color: #34495e;
}

.ui.celled.striped.table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.ui.celled.striped.table {
    border: 1px solid #ddd;
}

/* Dropzone */
#file-dropzone {
    border: 2px dashed #9b59b6;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    padding: 30px;
    text-align: center;
    background: #fff;
}

#file-dropzone:hover,
#file-dropzone.active {
    background: rgba(155, 89, 182, 0.05);
}

#file-dropzone .header {
    color: #666;
}

/* Collection info panel */
#collection-info {
    background: #fff;
    border-left: 4px solid #9b59b6;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#collection-info .collection-name {
    font-size: 1.2em;
    font-weight: 700;
    color: #2c3e50;
}

#collection-info .collection-desc {
    color: #666;
    margin-top: 4px;
}

#collection-info .collection-stats {
    margin-top: 8px;
    color: #555;
    font-size: 0.95em;
}

/* Query tab collection info */
#query-collection-info {
    background: #fff;
    border-left: 4px solid #9b59b6;
    border-radius: 4px;
    padding: 12px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Method labels */
.method-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85em;
    color: #fff;
    min-width: 60px;
    text-align: center;
}

.method-label.get { background: #27ae60; }
.method-label.post { background: #2980b9; }
.method-label.put { background: #f39c12; }
.method-label.delete { background: #e74c3c; }
.method-label.patch { background: #8e44ad; }

/* Code in tables */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* Inline form row */
.inline-form-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.inline-form-row .field {
    flex: 1;
    margin-bottom: 0;
}

/* Section spacing */
.section-spacing {
    margin-bottom: 16px;
}

/* Warning message */
.ui.warning.message {
    border-left: 4px solid #f2711c;
}

/* Progress bar */
.ui.progress .bar {
    background: #9b59b6;
    transition: width 0.3s ease;
}


/* Snippet cell */
.snippet-cell {
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* LLM answer */
#llm-answer {
    background: #fff;
    border-left: 4px solid #9b59b6;
    border-radius: 4px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    line-height: 1.6;
    font-size: 0.95em;
}

#llm-answer .llm-model-label {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 8px;
}

#llm-answer .llm-answer-content {
    color: #2c3e50;
}

/* Utility */
.hidden {
    display: none !important;
}

.flex-fill {
    flex: 1;
}
