/*
 * Plans timeline panel styles.
 *
 * Owned by the collavre_plan engine (not the host application.css) so the
 * engine ships its own CSS. Loaded via stylesheet_link_tag in the engine's
 * navigation panel partial. Design tokens (--color-*, --surface-*, --ease-*)
 * are provided globally by collavre/design_tokens.css.
 */

#plans-list-area {
    max-width: var(--max-width);
    width: min(100%, var(--max-width));
    margin: 0.5em auto;
    box-sizing: border-box;
}

#plans-list-area hr {
    border: 0;
    border-top: 1px solid var(--color-border);
}

.horizontal-timeline {
    overflow-x: auto;
    position: relative;
    padding-bottom: 1em;
    width: 100%;
}

.plans-timeline-wrapper {
    position: relative;
    width: 100%;
}

.plans-timeline-wrapper #timeline-today-btn {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
}

.horizontal-timeline .timeline-scroll {
    position: relative;
    white-space: nowrap;
    height: 120px;
}

.horizontal-timeline .timeline-day {
    display: inline-block;
    width: 80px;
    box-sizing: border-box;
    border-right: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.8em;
}

.plan-form-container {
    padding: 0.5em;
    display: flex;
    justify-content: flex-end;
}

.plan-form-container form {
    display: flex;
    flex-direction: column;
    gap: var(--paragraph-space-1);
    max-width: min(28rem, 100%);
}

.plan-bar {
    position: absolute;
    height: 20px;
    background: var(--color-border);
    border-radius: var(--radius-2);
    overflow: hidden;
    cursor: pointer;
}

.plan-bar .plan-progress {
    background: var(--color-complete);
    height: 100%;
}

.plan-bar .plan-label {
    position: absolute;
    left: 2px;
    top: 2px;
    font-size: 0.75em;
    color: var(--color-text);
}

.plan-bar .delete-plan-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    border: none;
    background: none;
    font-weight: bold;
    cursor: pointer;
    color: var(--color-bg);
}

/* Registration markers: creatives drawn at their created_at (single day). */
.plan-bar--registration {
    background: var(--color-link);
    opacity: 0.85;
    min-width: 6px;
}

.plan-bar--registration .plan-progress {
    background: transparent;
}

/* Modification markers: creatives drawn at their updated_at (single day).
   Amber to read as distinct from the blue registration markers. */
.plan-bar--modification {
    background: var(--color-warning);
    opacity: 0.85;
    min-width: 6px;
}

.plan-bar--modification .plan-progress {
    background: transparent;
}

/* Timeline chip filters (Registered, ...) — default-off toggles. */
.timeline-controls {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.25em;
}

.timeline-chips {
    display: flex;
    gap: 0.25em;
}

.timeline-chip {
    /* Inactive chips sit on a neutral surface (not transparent) so the off-state
       still reads as a toggle against the timeline background, without looking
       active. */
    border: 1px solid var(--color-border);
    background: var(--surface-secondary);
    color: var(--color-text);
    border-radius: var(--radius-round);
    padding: 0.1em 0.7em;
    font-size: 0.75em;
    line-height: 1.6;
    cursor: pointer;
    transition: background-color 0.15s var(--ease-2), color 0.15s var(--ease-2), border-color 0.15s var(--ease-2);
}

.timeline-chip:hover {
    background: var(--surface-hover);
    color: var(--color-text);
}

.timeline-chip:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 1px;
}

.timeline-chip--active {
    background: var(--color-link);
    border-color: var(--color-link);
    color: var(--color-bg);
}

/* Keep the active chip filled on hover — don't fall back to the inactive surface. */
.timeline-chip--active:hover {
    background: var(--color-link);
    color: var(--color-bg);
}

/* The Modified chip's active fill matches its amber timeline markers
   (.plan-bar--modification) so the filter color maps to the dots it controls.
   --text-on-badge is the codebase convention for text over --color-warning. */
#chip-modifications.timeline-chip--active,
#chip-modifications.timeline-chip--active:hover {
    background: var(--color-warning);
    border-color: var(--color-warning);
    color: var(--text-on-badge);
}
