/*
 * Styles for the hub's own panel views (dashboard guide, calendar, performance).
 *
 * Plain CSS on purpose: the panel is deployed with `filament:assets`, not a Vite build, and
 * Filament's compiled stylesheet only holds the utility classes Filament itself uses (there is no
 * `p-4` in it). Colours come from the variables Filament puts on the page, so the primary colour
 * and the dark theme apply here without being named.
 */

:root {
    --hub-border: var(--gray-200);
    --hub-muted: var(--gray-600);
    --hub-surface: var(--gray-50);
    --hub-hover: var(--gray-100);
    --hub-text: var(--gray-950);
    /* Primary as text: the 600 shade is too pale on white. */
    --hub-accent: var(--primary-700);
}

.dark {
    --hub-border: rgb(255 255 255 / 0.1);
    --hub-muted: var(--gray-400);
    --hub-surface: rgb(255 255 255 / 0.04);
    --hub-hover: rgb(255 255 255 / 0.08);
    --hub-text: var(--gray-100);
    --hub-accent: var(--primary-400);
}

/* Filament's own empty value ("—", "ne istječe") is gray-400 on white, 2.6:1: too faint to read. */
.fi-ta-placeholder,
.fi-in-placeholder {
    color: var(--hub-muted);
}

/* Tones shared by every view: a status colour is one of Filament's semantic colours. */
[data-tone='success'] { --hub-tone: var(--success-600); }
[data-tone='warning'] { --hub-tone: var(--warning-600); }
[data-tone='danger'] { --hub-tone: var(--danger-600); }
[data-tone='info'] { --hub-tone: var(--info-600); }
[data-tone='gray'] { --hub-tone: var(--gray-500); }

/* ---- Setup guide ---- */

.hub-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hub-step {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--hub-border);
    border-radius: 0.75rem;
}

.hub-step--next {
    border-color: var(--primary-600);
    background: var(--hub-surface);
}

.hub-step__marker {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    border: 1px solid var(--hub-border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--hub-muted);
}

.hub-step--next .hub-step__marker {
    border-color: var(--primary-600);
    background: var(--primary-600);
    color: #fff;
}

.hub-step--done .hub-step__marker {
    border-color: var(--success-600);
    background: var(--success-600);
    color: #fff;
}

.hub-step__check {
    width: 1rem;
    height: 1rem;
}

.hub-step__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.hub-step__label {
    font-weight: 600;
}

.hub-step--done .hub-step__label {
    color: var(--hub-muted);
    text-decoration: line-through;
}

.hub-step__hint {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--hub-muted);
}

.hub-step--done .hub-step__hint {
    display: none;
}

@media (max-width: 639px) {
    .hub-step {
        flex-wrap: wrap;
    }

    .hub-step__body {
        flex-basis: calc(100% - 3rem);
    }
}

/* ---- Toolbars (calendar, performance) ---- */

.hub-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hub-toolbar__nav,
.hub-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.hub-toolbar__title {
    min-width: 10rem;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    text-transform: capitalize;
}

.hub-toolbar__filter {
    min-width: 12rem;
}

.hub-toolbar__note {
    font-size: 0.8125rem;
    color: var(--hub-muted);
}

/* ---- Calendar ---- */

.hub-cal__weekdays,
.hub-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.375rem;
}

.hub-cal__weekdays {
    margin-bottom: 0.375rem;
    padding: 0 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--hub-muted);
}

.hub-cal__day {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    min-height: 6.5rem;
    min-width: 0;
    padding: 0.375rem;
    border: 1px solid var(--hub-border);
    border-radius: 0.625rem;
}

.hub-cal__day--outside {
    background: var(--hub-surface);
    border-style: dashed;
}

.hub-cal__day--today {
    border-color: var(--primary-600);
    box-shadow: inset 0 0 0 1px var(--primary-600);
}

.hub-cal__date {
    margin-bottom: 0.125rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hub-muted);
}

.hub-cal__day--today .hub-cal__date {
    color: var(--hub-accent);
}

/* The weekday only shows where the grid has become a list. */
.hub-cal__weekday-inline {
    display: none;
    margin-left: 0.25rem;
    text-transform: uppercase;
    font-weight: 500;
}

.hub-cal__item {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.1875rem 0.375rem;
    border-left: 3px solid var(--hub-tone, var(--gray-500));
    border-radius: 0.25rem;
    background: var(--hub-surface);
    font-size: 0.6875rem;
    line-height: 1.3;
    color: inherit;
    text-decoration: none;
}

.hub-cal__item:hover {
    background: var(--hub-hover);
}

.hub-cal__text,
.hub-cal__brand {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hub-cal__time {
    font-weight: 700;
}

.hub-cal__brand {
    color: var(--hub-muted);
}

.hub-cal__more {
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    color: var(--hub-muted);
}

.hub-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 1rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--hub-muted);
}

.hub-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.hub-legend__item::before {
    content: '';
    width: 0.5625rem;
    height: 0.5625rem;
    border-radius: 0.125rem;
    background: var(--hub-tone, var(--gray-500));
}

/* Seven columns do not fit a phone: the month becomes a list of the days that have something in them. */
@media (max-width: 767px) {
    .hub-cal__weekdays {
        display: none;
    }

    .hub-cal__grid {
        display: flex;
        flex-direction: column;
    }

    .hub-cal__day {
        min-height: 0;
    }

    .hub-cal__day--outside,
    .hub-cal__day--empty:not(.hub-cal__day--today) {
        display: none;
    }

    .hub-cal__weekday-inline {
        display: inline;
    }

    .hub-cal__item {
        font-size: 0.8125rem;
    }
}

/* ---- Performance tables ---- */

.hub-table-wrap {
    overflow-x: auto;
}

.hub-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.hub-table--fixed {
    table-layout: fixed;
    min-width: 36rem;
}

.hub-table th {
    padding: 0.375rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
    color: var(--hub-muted);
}

.hub-table td {
    padding: 0.5rem;
    border-top: 1px solid var(--hub-border);
    vertical-align: middle;
}

.hub-table .is-num {
    text-align: right;
    white-space: nowrap;
}

.hub-table__sub {
    font-size: 0.75rem;
    color: var(--hub-muted);
}

.hub-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hub-bar__fill {
    flex: none;
    width: var(--hub-bar, 0%);
    min-width: 2px;
    height: 0.5rem;
    border-radius: 0.25rem;
    background: var(--primary-600);
}

.hub-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* A table that scrolls sideways has to be reachable from the keyboard. */
.hub-table-wrap:focus-visible {
    outline: 2px solid var(--primary-600);
    outline-offset: 2px;
}

/* ---- Post preview (the media of one channel) ---- */

.hub-media {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hub-media__note,
.hub-media__status {
    font-size: 0.8125rem;
    color: var(--hub-muted);
}

.hub-media__status strong {
    color: var(--hub-text);
}

.hub-media__list {
    margin: 0.25rem 0 0 1rem;
    padding: 0;
    list-style: disc;
}

.hub-media__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/*
 * The card stands for the platform's screen, so it keeps light colours of its own in the dark
 * theme too: what is checked here is how the post will look to the people who see it.
 */
.hub-post {
    --post-text: #111827;
    --post-muted: #4b5563;
    --post-line: rgb(107 114 128 / 0.4);
    max-width: 32.5rem;
    overflow: hidden;
    border: 1px solid var(--post-line);
    border-radius: 0.75rem;
    background: #fff;
    color: var(--post-text);
}

.hub-post--vertical {
    max-width: 22.5rem;
}

.hub-post__head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem;
}

.hub-post__avatar {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    background: var(--hub-brand, #1d4ed8);
    color: #fff;
    font-weight: 700;
}

.hub-post__name {
    font-size: 0.875rem;
    font-weight: 600;
}

.hub-post__meta,
.hub-post__voice-said {
    font-size: 0.75rem;
    color: var(--post-muted);
}

.hub-post__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    aspect-ratio: var(--hub-ratio, 1 / 1);
    max-height: 32.5rem;
    padding: 1rem;
    background: #f3f4f6;
    color: var(--post-muted);
    font-size: 0.8125rem;
    text-align: center;
}

.hub-post__spinner {
    width: 1.5rem;
    height: 1.5rem;
}

.hub-post__caption {
    padding: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.hub-post__caption--lead {
    padding-top: 0;
    font-size: 0.875rem;
}

.hub-post__link-card {
    margin: 0 0.75rem 0.75rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--post-line);
    border-radius: 0.5rem;
    background: #f9fafb;
}

.hub-post__host {
    font-size: 0.6875rem;
    text-transform: uppercase;
    color: var(--post-muted);
}

.hub-post__video {
    display: block;
    width: 100%;
    max-height: 35rem;
    background: #000;
}

.hub-post__voice {
    margin: 0 0.75rem 0.75rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

.hub-post__voice summary {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    font-weight: 600;
}

.hub-post__voice-icon {
    width: 1rem;
    height: 1rem;
}

.hub-post__voice ol {
    margin: 0.375rem 0 0 1.125rem;
    padding: 0;
}

.hub-post__voice .is-silent {
    font-style: italic;
    color: var(--post-muted);
}

.hub-post__slides-wrap {
    position: relative;
}

.hub-post__count {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 1;
    padding: 0.1875rem 0.5625rem;
    border-radius: 9999px;
    background: rgb(0 0 0 / 0.7);
    color: #fff;
    font-size: 0.75rem;
}

.hub-post__slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.hub-post__slides img {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
}

.hub-post__ig {
    padding: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.hub-post__ig-text {
    white-space: pre-wrap;
}

.hub-post__ig-more {
    color: var(--post-muted);
}

/* AI lik: pictures and voices to choose from (Brendovi → AI lik). */
.hub-candidates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.75rem;
}

.hub-candidates--voices {
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.hub-candidate {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.hub-candidate__img {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
}

.hub-candidate__label {
    font-size: 0.875rem;
    font-weight: 600;
}

.hub-candidate__audio {
    width: 100%;
}

