/* Place custom styles - layered on top of Oat UI */

@font-face {
    font-family: 'Inter';
    src: url("../fonts/InterVariable.2bf3d951bf9d.woff2") format('woff2 supports variations'),
         url("../fonts/InterVariable.2bf3d951bf9d.woff2") format('woff2-variations');
    font-weight: 100 1000;
}

:root {
    color-scheme: light; /* pin light theme; Oat otherwise follows the OS via light-dark() */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius-small: 4px;
    --radius-medium: 4px;
    --container-max: 900px;
}

/* Font smoothing */
* {
    font-optical-sizing: auto;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

#layout-container {
    margin: 0 auto;
    max-width: 900px;
}

/* Header nav: two-list spread layout (Pico convention, not provided by Oat) */
header.container nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header.container nav ul {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
    list-style: none;
    margin: 0;
    padding: 0;
}

/* hgroup: title + subtitle pairing (Pico styled this, Oat does not) */
hgroup {
    margin-bottom: var(--space-6);
}

hgroup > :first-child {
    margin-bottom: var(--space-1);
}

hgroup > :not(:first-child) {
    margin: 0;
    color: var(--muted-foreground);
}

/* Flash messages (django.contrib.messages), rendered in _base.html */
.messages {
    margin-bottom: var(--space-4, 1rem);
}

.message {
    padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
    margin-bottom: var(--space-2, 0.5rem);
    border-radius: var(--radius-medium, 4px);
    border: 1px solid var(--border, #e5e5e5);
    border-left-width: 4px;
    background: var(--card, #fff);
}

.message-success {
    border-left-color: #2e7d32;
    background: #edf7ee;
    color: #1e4620;
}

.message-error {
    border-left-color: var(--danger, #d93526);
    background: #fdeded;
    color: #5f2120;
}

.message-warning {
    border-left-color: #d97706;
    background: #fff7ed;
    color: #7c2d12;
}

/* Form field errors — rendered as <p>, not Django's default <ul class="errorlist"> */
.form-error {
    color: var(--danger, #d93526);
    font-size: 0.875em;
    margin: 0 0 var(--space-4, 1rem);
}

/* Modal close button, positioned against the dialog header */
dialog header {
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0;
    right: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0.25rem 0.5rem;
}

.modal-close:hover {
    color: #000;
    background: none;
}

/* Sync/connect progress panel (templates/_progress.html) */
.progress-panel {
    text-align: center;
    padding: var(--space-8) var(--space-4);
}

.progress-panel .progress-message {
    margin: var(--space-3) 0 0;
    font-weight: 500;
}

.progress-panel .progress-detail {
    margin: var(--space-1) 0 0;
    color: var(--muted-foreground);
}

.progress-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--muted, #e5e5e5);
    border-top-color: var(--foreground, #000);
    border-radius: 50%;
    animation: progress-spin 0.8s linear infinite;
}

@keyframes progress-spin {
    to { transform: rotate(360deg); }
}

.progress-check {
    display: inline-block;
    font-size: 1.6rem;
    line-height: 1;
}

.progress-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-4);
}

/* Version history (templates/websites/version_list.html) */
.rollback-selected-bar {
    margin-bottom: var(--space-4, 1rem);
}

.badge-latest {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--muted, #f0f0f0);
    font-size: 0.8rem;
    font-weight: 600;
}

.version-table button,
.version-files-table button {
    margin: 0;
    padding: 4px 12px;
    font-size: 0.8rem;
}

.version-controls {
    text-align: right;
    white-space: nowrap;
}

.version-files-table {
    margin: 0;
}

.version-files-check {
    width: 2rem;
}

.change-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.change-added {
    color: #2e7d32;
}

.change-edited {
    color: #b45309;
}

.change-deleted {
    color: var(--danger, #d93526);
}

.change-unchanged {
    color: var(--muted-foreground, #888);
    font-weight: 400;
}

.version-unchanged summary {
    cursor: pointer;
    color: var(--muted-foreground, #888);
    margin: var(--space-2, 0.5rem) 0;
}

.version-preview-frame {
    width: 100%;
    height: 420px;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: var(--radius-medium, 4px);
    background: #fff;
}

.rollback-warning {
    border-left: 4px solid #d97706;
    background: #fff7ed;
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
}

.rollback-file-list {
    max-height: 14rem;
    overflow-y: auto;
}

/* Provider picker (templates/websites/site_create.html) */
.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.provider-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.provider-card[data-disabled] {
    opacity: 0.5;
    pointer-events: none;
}
