/* Headlines - Custom styles */

/* Body text uses Lato;  */
body {
    font-family: "Lato", sans-serif;
}

h1 {
    font-family: "Raleway", Sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
}

h2 {
    font-family: "Raleway", Sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

a[role="button"]:not(.secondary), button.primary {
    padding: 18px 38px;
    border: none;               /* remove default border */
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;

    /* Solid orange with subtle vertical gradient */
    background: linear-gradient(
      180deg,
      #FD8733 0%,    /* lighter warm orange */
      #f16822 100%   /* deeper orange       */
    );
  }

  /* Normalize button spacing */
  [type=button], [type=reset], [type=submit] {
    margin-bottom: 0px;
  }

/* Default styling */


/* Login card */
.login-card {
    max-width: 400px;
    margin: 4rem auto;
}

/* Flash messages */
.flash-message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--pico-border-radius);
}

.flash-error {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.flash-success {
    background-color: #dcfce7;
    border-left: 4px solid #22c55e;
    color: #166534;
}

/* Stats */
.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background-color: #e5e7eb;
    color: #374151;
}

.status-running {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-success {
    background-color: #dcfce7;
    color: #166534;
}

.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-ambiguous {
    background-color: #fef3c7;
    color: #92400e;
}

/* Access level badges */
.access-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.access-viewer {
    background-color: #e5e7eb;
    color: #374151;
}

.access-editor {
    background-color: #dbeafe;
    color: #1e40af;
}

.access-admin {
    background-color: #fae8ff;
    color: #86198f;
}

/* Sync status badges */
.sync-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.sync-synced {
    background-color: #dcfce7;
    color: #166534;
}

.sync-modified {
    background-color: #fef3c7;
    color: #92400e;
}

.sync-untracked {
    background-color: #e5e7eb;
    color: #374151;
}

.sync-db-only {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Nav user display */
.nav-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-user .username {
    font-weight: 500;
}

/* Muted text */
.muted {
    color: var(--pico-muted-color);
}

/* Small buttons */
button.small,
[role="button"].small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Error card */
.error-card {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
}

.error-card header {
    color: #991b1b;
}

/* Warning card and banner */
.warning {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.warning-banner {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: var(--pico-border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.warning-banner p {
    margin: 0;
    color: #92400e;
    font-size: 0.9rem;
}

/* Report content */
.report-content {
    max-height: 600px;
    overflow-y: auto;
}

.report-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: var(--pico-card-background-color);
    padding: 1rem;
    border-radius: var(--pico-border-radius);
}

/* Context source indicators */
.source-indicator {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.source-active {
    background-color: #dcfce7;
    color: #166534;
}

.source-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Text colors */
.text-success {
    color: #166534;
}

.text-warning {
    color: #92400e;
}

.text-error {
    color: #991b1b;
}

.text-right {
    text-align: right;
}

/* Breadcrumb styling */
nav[aria-label="breadcrumb"] ul {
    padding: 0;
    margin: 0 0 1rem 0;
}

/* Navbar logo sizing */
.navbar-logo {
    max-width: 200px;
    height: auto;
}

nav[aria-label="breadcrumb"] li {
    display: inline;
}

nav[aria-label="breadcrumb"] li:not(:last-child)::after {
    content: " / ";
    color: var(--pico-muted-color);
}

/* Table improvements */
table.striped tbody tr:nth-child(odd) {
    background-color: var(--pico-card-background-color);
}

/* Inactive row styling */
.inactive-row {
    opacity: 0.6;
}

/* Actions bar */
.actions-bar {
    margin-bottom: 1.5rem;
}

/* Config editor layout */
.config-editor-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}

.editor-main {
    min-width: 0;
}

.editor-sidebar {
    min-width: 0;
}

.editor-sidebar article {
    position: sticky;
    top: 1rem;
}

.editor-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.editor-view-toggle button {
    margin-bottom: 0;
}

.editor-view-toggle button[aria-pressed="true"] {
    font-weight: 600;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

/* YAML editor textarea */
.yaml-editor {
    font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Segoe UI Mono', 'Liberation Mono', Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    tab-size: 2;
    resize: vertical;
}

/* CodeMirror container */
.codemirror-container {
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.codemirror-container .cm-editor {
    font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', 'Segoe UI Mono', 'Liberation Mono', Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
}

.codemirror-container .cm-editor.cm-focused {
    outline: 2px solid var(--pico-primary-focus);
    outline-offset: -1px;
}

/* Validation status */
.validation-success {
    color: #166534;
    font-weight: 500;
}

.validation-error {
    color: #991b1b;
    font-size: 0.875rem;
}

/* Version history */
.version-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.version-item:last-child {
    border-bottom: none;
}

.version-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.version-date {
    font-size: 0.875rem;
    font-weight: 500;
}

.version-user {
    font-size: 0.75rem;
}

.version-actions {
    margin: 0;
}

.version-actions button {
    margin: 0;
}

/* Grid improvements for small screens */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .config-editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-sidebar article {
        position: static;
    }

    .nav-user {
        display: none;
    }
}

/* Fieldset styling for radio groups */
fieldset {
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

fieldset legend {
    padding: 0 0.5rem;
    font-weight: 600;
}

fieldset label {
    display: block;
    margin-bottom: 0.5rem;
}

fieldset label:last-child {
    margin-bottom: 0;
}

/* Input with action button (verify, refresh) */
.input-with-action {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.input-with-action input,
.input-with-action select {
    flex: 1;
    margin-bottom: 0;
}

.input-with-action button {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Notion page verification status */
.verify-status {
    min-height: 1.5em;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.verify-ok {
    color: #166534;
    font-weight: 500;
}

.verify-error {
    color: #991b1b;
    font-weight: 500;
}

/* Column mapping grid */
.column-mapping-grid {
    margin-top: 0.5rem;
}

.column-mapping-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.column-mapping-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.column-mapping-select {
    margin-bottom: 0;
}

.mapping-warning {
    color: #92400e;
    font-weight: 700;
    cursor: help;
}

.option-missing {
    color: #991b1b;
    font-style: italic;
}

/* Hidden utility class */
.hidden {
    display: none;
}

/* Configuration validation results */
.config-validation-results {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-card-background-color);
}

.config-validation-results h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.validation-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.validation-check {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', monospace;
}

.validation-ok {
    background-color: #dcfce7;
    color: #166534;
}

.validation-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.validation-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.validation-error-item {
    background-color: #fee2e2;
    color: #991b1b;
}

.check-details {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    word-break: break-all;
}

/* Responsive column mapping */
@media (max-width: 768px) {
    .column-mapping-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .input-with-action {
        flex-direction: column;
    }
}

/* --- Rating & Feedback --- */

.star-rating {
    border: none;
    padding: 0;
}

.star-option {
    display: block;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: var(--pico-border-radius);
    margin-bottom: 0.25rem;
}

.star-option:hover {
    background-color: var(--pico-card-background-color);
}

.star-option input[type="radio"] {
    margin-right: 0.5rem;
}

.rating-value {
    font-weight: 600;
    color: #d97706;
}

.rating-bar {
    background-color: #d97706;
    border-radius: 4px;
    min-width: 2px;
    transition: width 0.3s ease;
}

/* Report content formatting */
.report-content pre {
    max-height: 80vh;
    overflow-y: auto;
}
