/*
 * Stylesheet for FF Realizacje PRO
 *
 * This file defines the visual appearance of the realizacje calendar, legend,
 * list panel and drawer. The design aims to blend with the existing FF BAR
 * Group dashboard: light backgrounds, subtle borders, rounded corners and
 * clear typography. Focus indicators and colour contrast are provided for
 * accessibility. Adjust variables here if you need to tweak colours or
 * spacing to match your theme.
 */

/* Wrapper for entire module */
.ff-rz-wrapper {
    margin-top: 1rem;
    border: 1px solid #ECE7DD;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
    padding: 1rem;
    font-family: inherit;
    position: relative;
    z-index: 0;
}

/* Toolbar */
.ff-rz-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.ff-rz-nav-left,
.ff-rz-nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ff-rz-month-label {
    font-weight: 600;
    font-size: 1rem;
}
.ff-rz-btn {
    padding: 6px 10px;
    border: 1px solid #ECE7DD;
    border-radius: 8px;
    background: #F7F7F7;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    transition: background-color 0.1s ease;
}
.ff-rz-btn:hover {
    background: #F5F5F5;
}
.ff-rz-btn:focus {
    outline: 2px solid #FBBF24;
    outline-offset: 2px;
}

/* Calendar header (days of week) */
.ff-rz-cal-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #ECE7DD;
    background: #FAFAF9;
}
.ff-rz-cal-dow {
    text-align: center;
    padding: 6px 0;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #111827;
}

/* Calendar grid */
.ff-rz-cal-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(80px, 1fr);
}
.ff-rz-day {
    border-right: 1px solid #F3F4F6;
    border-bottom: 1px solid #F3F4F6;
    padding: 4px 2px;
    position: relative;
    font-size: 0.75rem;
}
.ff-rz-day:nth-child(7n) {
    border-right: none;
}
.ff-rz-day.is-other-month {
    background: #F9FAFB;
    color: #9CA3AF;
}
.ff-rz-num {
    font-size: 0.75rem;
    font-weight: 600;
}
.ff-rz-events {
    margin-top: 4px;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}
.ff-rz-event {
    /* Enlarge event dots for better visibility */
    width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-block;
}
.ff-rz-event-more {
    font-size: 0.625rem;
    border: 1px solid #ECE7DD;
    padding: 0 3px;
    border-radius: 8px;
    line-height: 1;
    color: #111827;
}

/* Make day cells with events clickable */
.ff-rz-day.has {
    cursor: pointer;
}

/* Highlight the current day */
.ff-rz-day.is-today {
    box-shadow: inset 0 0 0 2px #ef4370;
    border-radius: 6px;
}

/* Focus state for keyboard navigation */
.ff-rz-day:focus {
    outline: 2px solid #ef4370;
    outline-offset: 2px;
}

/* Legend of types */
.ff-rz-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0.75rem;
}
.ff-rz-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #111827;
}
.ff-rz-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}
.ff-rz-legend-icon {
    font-size: 0.875rem;
    line-height: 1;
}

/* List panel */
.ff-rz-list {
    margin-top: 1rem;
}
.ff-rz-list-wrap {
    border: 1px solid #ECE7DD;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}
.ff-rz-list-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.875rem;
    background: #FAFAF9;
}
.ff-rz-list-summary::-webkit-details-marker {
    display: none;
}
.ff-rz-list-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.ff-rz-search,
.ff-rz-filter-type,
.ff-rz-filter-city {
    padding: 4px 6px;
    border: 1px solid #ECE7DD;
    border-radius: 6px;
    font-size: 0.8125rem;
    background: #ffffff;
    min-width: 80px;
}
.ff-rz-links-body {
    padding: 8px 10px;
}
.ff-rz-links-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}
.ff-rz-link-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 0.8125rem;
}
.ff-rz-link-row:last-child {
    border-bottom: none;
}
.ff-rz-link-row a {
    color: #111827;
    font-weight: 600;
    text-decoration: none;
}
.ff-rz-link-row a:hover {
    text-decoration: underline;
}
.ff-rz-link-meta {
    color: #6B7280;
    font-size: 0.75rem;
    white-space: nowrap;
}
.ff-rz-links-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 4px;
    font-size: 0.75rem;
}
.ff-rz-stats {
    color: #6B7280;
}

/* Drawer / modal */
.ff-rz-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: #ffffff;
    border-top: 1px solid #ECE7DD;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.08);
    display: none;
    flex-direction: column;
    z-index: 100;
}
.ff-rz-drawer[hidden] {
    display: none;
}
.ff-rz-drawer-content {
    padding: 12px;
    overflow-y: auto;
    max-height: inherit;
}
.ff-rz-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.ff-rz-drawer-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}
.ff-rz-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ff-rz-drawer-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid #ECE7DD;
    border-radius: 10px;
    padding: 8px;
    font-size: 0.8125rem;
}
.ff-rz-drawer-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ff-rz-drawer-icon {
    font-size: 1.25rem;
}
.ff-rz-drawer-item-title {
    font-weight: 600;
    font-size: 0.875rem;
}
.ff-rz-drawer-item-meta {
    font-size: 0.75rem;
    color: #6B7280;
}
.ff-rz-drawer-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ff-rz-warning {
    padding: 6px 8px;
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FCD34D;
    border-radius: 6px;
    font-size: 0.8125rem;
    margin-bottom: 8px;
}

/* Hidden source wrapper – off-screen to keep original links available in DOM */
.ff-rz-hidden-source {
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .ff-rz-links-list {
        max-height: 300px;
    }
    .ff-rz-list-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .ff-rz-link-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .ff-rz-link-meta {
        white-space: normal;
    }
    .ff-rz-drawer {
        max-height: 80vh;
    }
}

/* === FF Realizacje – Unified Buttons (black/gold) === */
.ff-rz-wrapper{
  --ff-rz-gold:#CCA352;
  --ff-rz-black:#111827;
  --ff-rz-white:#FFFFFF;
  --ff-rz-border:#ECE7DD;
  --ff-rz-shadow:0 2px 8px rgba(17,24,39,.06);
  --ff-rz-radius:10px;
}

.ff-rz-toolbar{ gap:.5rem; }
.ff-rz-month-label{ font-weight:800; letter-spacing:.2px; }

/* Base button */
.ff-rz-wrapper .ff-rz-btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:.35rem;
  min-height:38px; padding:.5rem .8rem;
  border:1px solid var(--ff-rz-gold);
  border-radius:var(--ff-rz-radius);
  background:var(--ff-rz-black);
  color:var(--ff-rz-white);
  font-weight:800; font-size:.9rem; line-height:1;
  box-shadow:var(--ff-rz-shadow);
  transition:transform .06s ease, filter .12s ease, box-shadow .12s ease, background .12s ease;
}
.ff-rz-wrapper .ff-rz-btn:hover{ filter:brightness(1.06); }
.ff-rz-wrapper .ff-rz-btn:active{ transform:translateY(1px); }
.ff-rz-wrapper .ff-rz-btn:focus{ outline:2px solid var(--ff-rz-gold); outline-offset:2px; }
.ff-rz-wrapper .ff-rz-btn[disabled]{ opacity:.5; cursor:not-allowed; filter:none; transform:none; }

/* Ghost (light) variant for secondary actions */
.ff-rz-wrapper .ff-rz-btn.is-ghost{
  background:var(--ff-rz-white);
  color:var(--ff-rz-black);
  border-color:var(--ff-rz-border);
}
.ff-rz-wrapper .ff-rz-btn.is-ghost:hover{
  box-shadow:0 3px 10px rgba(17,24,39,.08);
}

/* Button groups in toolbar */
.ff-rz-nav-left .ff-rz-btn, .ff-rz-nav-right .ff-rz-btn { border-radius:10px; }
.ff-rz-nav-left .ff-rz-btn:first-child{ border-top-right-radius:8px; border-bottom-right-radius:8px; }
.ff-rz-nav-left .ff-rz-btn + .ff-rz-btn{ margin-left:.25rem; }

/* Drawer buttons use ghost style for consistency */
.ff-rz-drawer .ff-rz-btn{ min-height:36px; }
.ff-rz-drawer .ff-rz-btn:not(:first-child){ margin-left:.25rem; }
.ff-rz-drawer .ff-rz-btn { background:var(--ff-rz-black); color:var(--ff-rz-white); border-color:var(--ff-rz-gold); }
.ff-rz-drawer .ff-rz-btn.is-ghost{ background:var(--ff-rz-white); color:var(--ff-rz-black); border-color:var(--ff-rz-border); }

/* List-panel footer button */
.ff-rz-links-foot .ff-rz-btn{ margin-left:.5rem; }

/* Today highlight stay consistent */
.ff-rz-day.is-today{ box-shadow: inset 0 0 0 2px var(--ff-rz-gold); border-radius:6px; }
.ff-rz-day:focus{ outline:2px solid var(--ff-rz-gold); outline-offset:2px; }

/* === Chips for expanded mode === */
.ff-rz-events{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.ff-rz-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:.2rem .5rem; border:1px solid #ECE7DD; border-radius:999px;
  font-size:.72rem; line-height:1; background:#fff; color:#111827;
  max-width:100%; white-space:nowrap; text-overflow:ellipsis; overflow:hidden;
}
.ff-rz-chip-ic{ font-size:.9em; line-height:1; }
.ff-rz-chip-lb{ font-weight:700; letter-spacing:.2px; }
.ff-rz-more-btn{ padding:.15rem .45rem; min-height:24px; font-size:.72rem }

/* Collapsible indicator arrow on list header */
.ff-rz-list-summary::after{ content:'▾'; margin-left:.5rem; font-weight:900; }
.ff-rz-list-wrap[open] .ff-rz-list-summary::after{ content:'▴'; }

/* Branding gold/black focus */
.ff-rz-btn:focus, .ff-rz-day:focus { outline-color:#CCA352; }
.ff-rz-day.is-today { box-shadow: inset 0 0 0 2px #CCA352; border-radius:6px; }
