/* RotBot Web UI — custom theme derived from rotbot-character.png */

/* ===== Color scheme: teal/steel blue + copper accents ===== */
[data-theme="dark"] {
    --pico-background-color: #121416;          /* neutral dark gray */
    --pico-card-background-color: #1a1d20;      /* slightly lighter gray */
    --pico-card-sectioning-background-color: #161a1d;
    --pico-primary: #5ba8c8;                    /* steel blue (from body) */
    --pico-primary-hover: #7abfd8;
    --pico-primary-focus: rgba(91, 168, 200, 0.25);
    --pico-primary-inverse: #1a2c33;
    --pico-secondary: #c88a3c;                  /* copper/orange accent */
    --pico-secondary-hover: #d9a050;
    --pico-secondary-focus: rgba(200, 138, 60, 0.25);
    --pico-secondary-inverse: #1a2c33;
    --pico-color: #d0dfe6;                      /* light ice blue text */
    --pico-muted-color: #8a939a;                /* muted gray */
    --pico-muted-border-color: #2e3338;         /* border gray */
    --pico-table-border-color: #2e3338;
    --pico-ins-color: #4aba8a;                  /* green (success) */
    --pico-del-color: #e06060;                  /* red (error) */
    --pico-code-background-color: #0e1012;
    --pico-form-element-background-color: #0e1012;
    --pico-form-element-border-color: #2e3338;
    --pico-form-element-focus-color: #5ba8c8;
    --pico-nav-element-spacing-horizontal: 0.8rem;
}

/* Nav bar */
nav {
    background: #16181b;
    border-bottom: 1px solid #2a2e32;
}

/* ===== Status badges ===== */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-success {
    background: #4aba8a;
    color: #1a2c33;
}

.badge-danger {
    background: #e06060;
    color: #1a2c33;
}

.badge-warning {
    background: #c88a3c;
    color: #1a2c33;
}

.badge-info {
    background: #5ba8c8;
    color: #1a2c33;
}

.badge-published {
    background: #4aba8a;
    color: #1a2c33;
}

.badge-scheduled {
    background: #7a6be6;
    color: #fff;
}

/* ===== Layout helpers ===== */
.stats-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}

.secondary-text {
    color: var(--pico-muted-color);
}

.error-text {
    color: var(--pico-del-color);
    font-weight: 600;
}

.error-article {
    border-left: 4px solid var(--pico-del-color);
    padding: 1rem;
    margin: 1rem 0;
}

/* ===== Table styling ===== */
.small-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    margin: 0;
}

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

table input[type="checkbox"][role="switch"] {
    margin: 0;
}

table td, table th {
    padding: 0.5rem 0.75rem;
    border: none;
}

table {
    background: none;
    border-radius: 6px;
    border-collapse: collapse;
    border-spacing: 0;
}

table thead {
    background: #0e1012;
}

table thead th {
    border-bottom: none;
}

table tbody tr:nth-child(odd) td {
    background: #161a1d !important;
}

table tbody tr:nth-child(even) td {
    background: #1c2024 !important;
}

table tbody tr:hover td {
    background: #24292e !important;
}

/* ===== Dashboard cards ===== */
article {
    background: var(--pico-card-background-color);
    border: 1px solid #2e3338;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.dashboard-grid article {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.dashboard-grid .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dashboard-grid .card-description {
    flex: 1;
}

.dashboard-grid .card-meta {
    margin-top: auto;
}

/* ===== Video preview ===== */
video {
    border-radius: 8px;
    background: #000;
}

/* ===== Nav logo ===== */
nav ul li a img.nav-logo {
    height: 120px !important;
    width: auto !important;
    max-height: 120px !important;
    vertical-align: middle;
}

nav ul li a {
    font-size: 0.9rem;
}

/* ===== Buttons — copper accent for primary action ===== */
button:not(.outline):not(.secondary) {
    background: #5ba8c8;
    border-color: #5ba8c8;
    color: #1a2c33;
}

button:not(.outline):not(.secondary):hover {
    background: #7abfd8;
    border-color: #7abfd8;
}

button.outline {
    border-color: #5ba8c8;
    color: #5ba8c8;
}

button.outline:hover {
    background: rgba(91, 168, 200, 0.1);
}

/* ===== Links ===== */
a {
    color: #5ba8c8;
}

a:hover {
    color: #7abfd8;
}

/* ===== Details/summary ===== */
details summary {
    color: #d0dfe6;
}

/* ===== Toast notifications ===== */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a2c33;
    pointer-events: auto;
    animation: toast-in 0.25s ease-out, toast-out 0.3s ease-in forwards;
    animation-delay: 0s, var(--toast-duration, 3s);
    max-width: 340px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.toast-success { background: #4aba8a; }
.toast-error   { background: #e06060; color: #fff; }
.toast-info    { background: #5ba8c8; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(0.75rem); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-0.5rem); }
}

/* ===== Button loading state (htmx adds .htmx-request while in-flight) ===== */
button.htmx-request, button.htmx-request:hover {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

button.htmx-request::after {
    content: '';
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    margin-left: 0.4em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.5s linear infinite;
    vertical-align: middle;
}

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

/* ===== Scrollbar (webkit) ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #121416;
}

::-webkit-scrollbar-thumb {
    background: #2e3338;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3e4348;
}
