/* css/zile-libere.css — Zile libere: sărbătorile legale pe luni și ideile de minivacanță.
   Culorile zilelor sunt ale calendarelor de zile libere cu care oamenii sunt obișnuiți:
   roșu = sărbătoare, galben = zi de concediu propusă, piersică = weekend. */

#zl-section {
    --zl-holiday: #e11d1d;
    --zl-holiday-text: #ffffff;
    --zl-leave: #fcc419;
    --zl-leave-text: #3b2a00;
    --zl-weekend: #fed7aa;
    --zl-weekend-head: #1d4ed8;
    --zl-other-year: #fde2e4;
    --zl-other-year-border: #db2777;
    --zl-grid: #d6dbe1;
}
body.dark-theme #zl-section {
    --zl-holiday: #dc2626;
    --zl-leave: #eab308;
    --zl-leave-text: #1f1600;
    --zl-weekend: rgba(251, 146, 60, 0.24);
    --zl-weekend-head: #93c5fd;
    --zl-other-year: rgba(244, 114, 182, 0.16);
    --zl-other-year-border: #be185d;
    --zl-grid: rgba(255, 255, 255, 0.14);
}

#zl-section .container { max-width: 1140px; }

.zl-muted { color: var(--secondary-text-color); }
.zl-small { font-size: 0.82rem; margin: 0.6rem 0 0; }

/* ─── Anul ─────────────────────────────────────────────────────────────── */
/* 2010–2030, pe rânduri: fiecare buton e anul + câte zile libere are în timpul săptămânii. */
.zl-years {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.6rem, 1fr));
    gap: 0.45rem;
    max-width: 920px;
    margin: 0 auto 1.25rem;
}
.zl-year {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 0.4rem 0.4rem;
    border: 1px solid var(--card-border);
    border-radius: 0.8rem;
    background: transparent;
    color: var(--text-color);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.zl-year small { font-size: 0.7rem; font-weight: 400; color: var(--secondary-text-color); }
.zl-year:hover { border-color: var(--link-color); }
.zl-year.is-active {
    background: var(--link-color);
    border-color: var(--link-color);
    color: #ffffff;
}
.zl-year.is-active small { color: rgba(255, 255, 255, 0.85); }
.zl-year small.zl-year-total { font-weight: 700; color: var(--zl-holiday); }
.zl-year.is-active small.zl-year-total { color: #ffffff; }
.zl-year.is-this-year:not(.is-active) { border-color: var(--link-color); border-width: 2px; }

/* Strâns (din oficiu): doar anul trecut, anul acesta și anul viitor (+ anul deschis, dacă e altul), pe un rând. */
.zl-years.is-collapsed { display: flex; flex-wrap: wrap; justify-content: center; }
.zl-years.is-collapsed .zl-year { min-width: 6.5rem; }
.zl-years.is-collapsed .zl-year.is-far { display: none; }
.zl-years-more { text-align: center; margin: -0.85rem 0 1rem; }
.zl-years-more .btn { font-size: 0.82rem; text-decoration: none; }

/* Anii de după ultimul calendar: doar totalul, fără buton (nu au calendar de deschis). */
.zl-future { max-width: 920px; margin: 0 auto 1.25rem; }
.zl-future[hidden] { display: none; }
.zl-future-title { font-size: 0.78rem; color: var(--secondary-text-color); margin: 0 0 0.35rem; text-align: center; }
.zl-future-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.6rem, 1fr));
    gap: 0.35rem;
}
.zl-future-year {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.3rem;
    border: 1px dashed var(--card-border);
    border-radius: 0.6rem;
    line-height: 1.2;
    cursor: help;
}
.zl-future-year strong { font-size: 0.9rem; color: var(--secondary-text-color); }
.zl-future-year small { font-size: 0.68rem; font-weight: 700; color: var(--zl-holiday); }

/* Câte zile libere are anul, fără cele care cad în weekend. */
.zl-total {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.25rem 0 0.35rem;
}
.zl-total-num { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--zl-holiday); }
.zl-total-text { font-size: 0.95rem; font-weight: 700; }

/* ─── Următoarea zi liberă ─────────────────────────────────────────────── */
.zl-next {
    max-width: 560px;
    margin: 0 auto 1.5rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--zl-holiday);
    border-radius: 0.8rem;
    background: var(--section-alt-bg);
    text-align: center;
}
.zl-next:empty { display: none; }
.zl-next-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--secondary-text-color);
}
.zl-next-name { font-size: 1.25rem; font-weight: 700; }
.zl-next-name + .zl-next-label { margin-top: 0.6rem; }
.zl-next-when { font-size: 0.92rem; }

/* ─── Lista sărbătorilor și ideile ─────────────────────────────────────── */
.zl-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.zl-card {
    padding: 1rem 1.1rem;
    border: 1px solid var(--card-border);
    border-radius: 0.8rem;
    background: var(--card-bg);
}
.zl-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.35rem; }
.zl-card > .zl-muted:first-of-type { font-size: 0.86rem; }

.zl-holidays { width: 100%; font-size: 0.88rem; border-collapse: collapse; }
.zl-holidays th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary-text-color);
    padding: 0.3rem 0.4rem;
    border-bottom: 1px solid var(--card-border);
}
.zl-holidays td { padding: 0.32rem 0.4rem; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.zl-holidays tr:last-child td { border-bottom: 0; }
.zl-col-date { font-weight: 700; white-space: nowrap; }
.zl-col-day { white-space: nowrap; color: var(--secondary-text-color); }
.zl-holidays tr.is-weekend .zl-col-day { color: var(--zl-weekend-head); font-weight: 700; }
.zl-holidays tr.is-past { opacity: 0.5; }

.zl-ideas { list-style: none; padding: 0; margin: 0; }
.zl-ideas li {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--card-border);
}
.zl-ideas li:last-child { border-bottom: 0; }
.zl-ideas li.is-past { opacity: 0.5; }
.zl-idea-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.zl-idea-range { font-weight: 700; }
.zl-idea-badge {
    flex-shrink: 0;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--zl-leave);
    color: var(--zl-leave-text);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.zl-idea-badge::after { content: ' zile'; font-weight: 400; }
.zl-idea-text { font-size: 0.86rem; color: var(--secondary-text-color); }
.zl-empty { color: var(--secondary-text-color); font-size: 0.88rem; }

/* ─── Legenda și butoanele ─────────────────────────────────────────────── */
.zl-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.zl-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.86rem;
}
.zl-legend li { display: flex; align-items: center; gap: 0.4rem; }
.zl-swatch {
    display: inline-block;
    width: 1.6rem;
    height: 1.05rem;
    border-radius: 0.2rem;
    border: 1px solid var(--zl-grid);
}
.zl-swatch.is-holiday { background: var(--zl-holiday); border-color: var(--zl-holiday); }
.zl-swatch.is-leave { background: var(--zl-leave); border-color: var(--zl-leave); }
.zl-swatch.is-weekend { background: var(--zl-weekend); }
.zl-swatch.is-other-year { background: var(--zl-other-year); }
.zl-swatch.is-today { box-shadow: inset 0 0 0 2px var(--link-color); }
.zl-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ─── Lunile ───────────────────────────────────────────────────────────── */
.zl-section-title { font-size: 1.25rem; font-weight: 700; margin: 0.5rem 0 1rem; }

.zl-months {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr));
    gap: 1.75rem 1.5rem;
}
/* Toate lunile au aceeași ramă (transparentă), ca luna curentă să se poată evidenția fără să miște nimic. */
.zl-month {
    min-width: 0;
    scroll-margin-top: 90px;
    padding: 0.75rem;
    margin: -0.75rem;
    border: 2px solid transparent;
    border-radius: 0.9rem;
    transition: opacity 0.15s ease;
}
.zl-month.is-current {
    border-color: var(--link-color);
    background: rgba(26, 188, 156, 0.08);
    box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.15);
}
/* Decembrie din anul trecut și ianuarie din anul viitor, la capetele anului ales. */
.zl-month.is-neighbor:not(.is-current) {
    border-style: dashed;
    border-color: var(--zl-other-year-border);
    background: var(--zl-other-year);
}
.zl-neighbor-tag {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--zl-other-year-border);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    vertical-align: 2px;
}
.zl-month.is-past { opacity: 0.5; }
.zl-month.is-past:hover { opacity: 1; }
.zl-month-cals {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.zl-cal-wrap { flex: 0 1 240px; min-width: 0; }
.zl-month-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-bottom: 0.5rem;
}
.zl-month-title.is-ideas { text-decoration: none; }
.zl-month.is-current .zl-cal-wrap:first-child .zl-month-title::after {
    content: 'luna aceasta';
    margin-left: 0.5rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--link-color);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    vertical-align: 2px;
    text-decoration: none;
    display: inline-block;
}
.zl-arrow {
    align-self: center;
    margin-top: 1.6rem;
    color: var(--secondary-text-color);
    font-size: 1.4rem;
}

.zl-cal {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--zl-grid);
    border-radius: 0.5rem;
    overflow: hidden;
    font-size: 0.85rem;
    background: var(--card-bg);
}
.zl-cal th, .zl-cal td {
    height: 1.75rem;
    padding: 0;
    text-align: center;
    border-right: 1px solid var(--zl-grid);
    border-bottom: 1px solid var(--zl-grid);
}
.zl-cal th:last-child, .zl-cal td:last-child { border-right: 0; }
.zl-cal tbody tr:last-child td { border-bottom: 0; }
.zl-cal th { font-weight: 700; font-size: 0.8rem; }
.zl-cal th.is-weekend { color: var(--zl-weekend-head); background: var(--zl-weekend); }
.zl-cal td.is-weekend { background: var(--zl-weekend); }
.zl-cal td.is-other-year { background: var(--zl-other-year); color: var(--secondary-text-color); }
.zl-cal td.is-holiday { background: var(--zl-holiday); color: var(--zl-holiday-text); font-weight: 700; cursor: help; }
.zl-cal td.is-leave { background: var(--zl-leave); color: var(--zl-leave-text); font-weight: 700; }
.zl-cal td.is-today { box-shadow: inset 0 0 0 2px var(--link-color); font-weight: 700; }
.zl-cal td.is-holiday.is-today { box-shadow: inset 0 0 0 2px var(--zl-holiday-text); }

.zl-month-notes {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0 0;
    font-size: 0.84rem;
}
.zl-month-notes li { position: relative; padding-left: 1rem; margin-bottom: 0.15rem; }
.zl-month-notes li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.42em;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 0.15rem;
}
.zl-month-notes li.is-holiday::before { background: var(--zl-holiday); }
.zl-month-notes li.is-idea::before { background: var(--zl-leave); }
.zl-tag {
    margin-left: 0.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    font-size: 0.7rem;
    color: var(--secondary-text-color);
    white-space: nowrap;
}

.zl-note {
    margin-top: 2rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 0.8rem;
    background: var(--section-alt-bg);
    font-size: 0.84rem;
    color: var(--secondary-text-color);
}
.zl-note p:last-child { margin-bottom: 0; }

/* Pe telefon, calendarul cu idei vine sub cel al lunii (săgeata arată în jos). */
@media (max-width: 575.98px) {
    .zl-month-cals { flex-direction: column; align-items: stretch; }
    .zl-cal-wrap { flex-basis: auto; }
    .zl-arrow { margin: 0; text-align: center; transform: rotate(90deg); }
    .zl-years, .zl-future-list { grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); }
}

/* La tipărit rămân doar calendarul și listele, cu culorile lor. */
@media print {
    #mainNav, .footer, .copyright, .masthead, .zl-years, .zl-years-more, .zl-future, .zl-next, .zl-actions, .zl-note { display: none !important; }
    #zl-section { padding-top: 0; }
    .zl-cal td, .zl-cal th, .zl-swatch, .zl-idea-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .zl-month { break-inside: avoid; }
}
