/* ================================================================
   CSS CUSTOM PROPERTIES — Core Design Palette (BTS-211)
   ================================================================ */

:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --color-primary: #2557a7;
    --color-primary-hover: #1a4187;
    --color-primary-light: #e8f0fe;
    --color-primary-subtle: #f0f5ff;
    --color-navbar: #1a2744;
    --color-text-primary: #2d2d2d;
    --color-text-secondary: #595959;
    --color-text-muted: #8c8c8c;
    --color-border: #e8e8e8;
    --color-border-light: #f0f0f0;
    --color-surface: #ffffff;
    --color-background: #fafafa;
    --color-background-alt: #f5f5f5;
    --color-success: #2e7d32;
    --color-success-light: #e8f5e9;
    --color-warning: #ed6c02;
    --color-warning-light: #fff3e0;
    --color-danger: #d32f2f;
    --color-danger-light: #fce4ec;
    --color-info: #0288d1;
    --color-info-light: #e1f5fe;
}

/* ================================================================
   GLOBAL STYLES
   ================================================================ */

html, body {
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    color: var(--color-text-primary);
}

h1:focus {
    outline: none;
}

.loading-progress {
    position: relative;
    display: inline-block;
    width: 8rem;
    height: 8rem;
    margin: 20% auto 1rem;
    text-align: center;
}

.loading-progress circle {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--color-primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

.navbar {
    background-color: var(--color-navbar);
    color: white;
    padding: 1rem;
}

.content {
    padding: 1rem;
}

/* LLM Models Management Section */
.llm-models-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

.models-header {
    margin-bottom: 1.5rem;
}

.models-table {
    overflow-x: auto;
}

.models-table table {
    width: 100%;
    border-collapse: collapse;
}

.models-table th,
.models-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.models-table th {
    background-color: var(--color-background-alt);
    font-weight: 600;
}

.models-table .model-name {
    font-family: monospace;
    font-size: 0.9em;
}

.models-table .description-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.models-table .actions-cell {
    white-space: nowrap;
}

.models-table .actions-cell button {
    margin-right: 0.5rem;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-badge.active {
    background-color: var(--color-success-light);
    color: var(--color-success);
}

.status-badge.inactive {
    background-color: var(--color-danger-light);
    color: var(--color-danger);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--color-surface);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
}

.close-button:hover {
    color: var(--color-text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 87, 167, 0.15);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn-secondary {
    background-color: var(--color-background-alt);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--color-border);
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background-color: #b71c1c;
}
