/* ========================================
   HARMONOGRAM ODPADÓW - KALENDARZ
   Spójny z motywem itlu (Dosis/Open Sans, #eb1038, border-radius:6px)
   ======================================== */

.waste-calendar {
    font-family: "Open Sans", sans-serif;
    width: 100%;
    margin: 0 auto;
    color: #222;
    line-height: 1.5;
}

.waste-calendar *,
.waste-calendar *::before,
.waste-calendar *::after {
    box-sizing: border-box;
}

/* Reset theme styles that leak into calendar */
.waste-calendar ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.waste-calendar li {
    padding-left: 0 !important;
}

.waste-calendar li:before {
    content: none !important;
    display: none !important;
}

/* --- Hide print/read/pdf/date bar on this page --- */
.print-pdf-icons {
    display: none !important;
}

/* --- Region selector --- */
.waste-calendar__selector {
    margin-bottom: 25px;
    padding: 25px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.waste-calendar__selector label {
    display: block;
    font-family: "Dosis", sans-serif;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 18px;
    color: #222;
}

.waste-calendar__selector select {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    font-family: "Open Sans", sans-serif;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    color: #222;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.waste-calendar__selector select:focus {
    outline: none;
    border-color: #eb1038;
    box-shadow: 0 2px 8px rgba(235, 16, 56, 0.1);
}

.waste-calendar__localities {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-style: italic;
    line-height: 1.6;
}

.waste-calendar__downloads {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.waste-calendar__dl-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    color: #fff !important;
    font-family: "Dosis", sans-serif;
    font-weight: 600;
    font-size: 15px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.waste-calendar__dl-btn--pdf {
    background: #eb1038;
    box-shadow: 0 2px 4px rgba(235, 16, 56, 0.2);
}

.waste-calendar__dl-btn--pdf:hover {
    background: #c50d2f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(235, 16, 56, 0.3);
    color: #fff !important;
}


/* --- View toggle & navigation --- */
.waste-calendar__controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.waste-calendar__nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.waste-calendar__nav-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #222;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.waste-calendar__nav-btn:hover {
    background: #eb1038;
    color: #fff;
    border-color: #eb1038;
    box-shadow: 0 2px 8px rgba(235, 16, 56, 0.3);
    transform: translateY(-1px);
}

.waste-calendar__month-title {
    font-family: "Dosis", sans-serif;
    font-size: 22px;
    font-weight: 700;
    min-width: 220px;
    text-align: center;
    color: #222;
}

.waste-calendar__month-title--year {
    min-width: auto;
    text-align: left;
}

.waste-calendar__view-toggle {
    display: flex;
    gap: 0;
}

.waste-calendar__view-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-family: "Dosis", sans-serif;
    font-weight: 600;
    color: #222;
    transition: all 0.3s ease;
}

.waste-calendar__view-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.waste-calendar__view-btn:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.waste-calendar__view-btn:hover {
    background: #f0f0f0;
}

.waste-calendar__view-btn--active {
    background: #eb1038;
    color: #fff;
    border-color: #eb1038;
}

.waste-calendar__view-btn--active:hover {
    background: #c50d2f;
}

/* --- Month grid --- */
.waste-calendar__month {
    margin-bottom: 25px;
}

.waste-calendar__month-header {
    font-family: "Dosis", sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px;
    background: #222;
    color: #fff;
    border-radius: 6px 6px 0 0;
}

.waste-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: #fff;
}

.waste-calendar__day-header {
    background: #f0f0f0;
    text-align: center;
    padding: 10px 4px;
    font-family: "Dosis", sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

.waste-calendar__day-header:nth-child(6),
.waste-calendar__day-header:nth-child(7) {
    color: #eb1038;
}

.waste-calendar__day {
    min-height: 60px;
    padding: 6px;
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    cursor: default;
    transition: background 0.2s ease;
}

.waste-calendar__day:nth-child(7n) {
    border-right: none;
}

.waste-calendar__day--empty {
    background: #fafafa;
}

.waste-calendar__day--today {
    background: #fff8e1;
    box-shadow: inset 0 0 0 2px #ffd700;
}

.waste-calendar__day--has-collection {
    cursor: pointer;
}

.waste-calendar__day--has-collection:hover {
    background: #fef0f2;
}

.waste-calendar__day-number {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
}

.waste-calendar__day--weekend .waste-calendar__day-number {
    color: #eb1038;
}

.waste-calendar__day-dots {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

.waste-calendar__dot {
    height: 5px;
    border-radius: 2px;
    display: block;
    border: none;
    box-shadow: none;
}

/* --- Tooltip (appended inside .waste-calendar__day) --- */
.waste-calendar__tooltip {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 4px;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 220px;
    max-width: 300px;
    font-size: 14px;
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
}

.waste-calendar__tooltip--visible {
    display: block;
}

.waste-calendar__tooltip-title {
    font-family: "Dosis", sans-serif;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 15px;
    color: #222;
    padding-bottom: 6px;
    border-bottom: 2px solid #eb1038;
}

.waste-calendar__tooltip-subtitle {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.waste-calendar__tooltip-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
}

.waste-calendar__tooltip-item + .waste-calendar__tooltip-item {
    border-top: 1px solid #f0f0f0;
}

.waste-calendar__tooltip-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
    margin-top: 2px;
}

.waste-calendar__tooltip-text {
    flex: 1;
    min-width: 0;
}

.waste-calendar__tooltip-desc {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    line-height: 1.4;
}

/* --- Legend --- */
.waste-calendar__legend {
    padding: 20px 25px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-top: 25px;
}

.waste-calendar__legend-title {
    font-family: "Dosis", sans-serif;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 15px;
    color: #222;
    padding-bottom: 10px;
    border-bottom: 2px solid #eb1038;
}

.waste-calendar__legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.waste-calendar__legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

.waste-calendar__legend-item:hover {
    background: #f0f0f0;
}

.waste-calendar__legend-color {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
    margin-top: 1px;
}

.waste-calendar__legend-text {
    flex: 1;
}

.waste-calendar__legend-name {
    font-family: "Dosis", sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #222;
}

.waste-calendar__legend-desc {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
    line-height: 1.4;
}

/* --- No data message --- */
.waste-calendar__empty {
    text-align: center;
    padding: 50px 20px;
    color: #666;
    font-size: 16px;
    background: #fafafa;
    border-radius: 6px;
    border: 1px dashed #ccc;
}

/* --- Year view --- */
.waste-calendar__year-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.waste-calendar__year-grid .waste-calendar__month-header {
    font-size: 13px;
    padding: 8px;
    letter-spacing: 0.5px;
}

.waste-calendar__year-grid .waste-calendar__day {
    min-height: 34px;
    padding: 3px;
}

.waste-calendar__year-grid .waste-calendar__day-number {
    font-size: 11px;
}

.waste-calendar__year-grid .waste-calendar__dot {
    height: 3px;
}

.waste-calendar__year-grid .waste-calendar__day-header {
    padding: 6px 2px;
    font-size: 11px;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .waste-calendar__year-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .waste-calendar__controls {
        flex-direction: column;
        align-items: stretch;
    }

    .waste-calendar__nav {
        justify-content: center;
    }

    .waste-calendar__view-toggle {
        justify-content: center;
    }

    .waste-calendar__month-title {
        font-size: 18px;
        min-width: auto;
    }

    .waste-calendar__day {
        min-height: 45px;
        padding: 4px;
    }

    .waste-calendar__legend-items {
        grid-template-columns: 1fr;
    }

    .waste-calendar__selector {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .waste-calendar__year-grid {
        grid-template-columns: 1fr;
    }

    .waste-calendar__day-header {
        font-size: 11px;
        padding: 6px 2px;
    }

    .waste-calendar__day-number {
        font-size: 12px;
    }

    .waste-calendar__dot {
        width: 8px;
        height: 8px;
    }

    .waste-calendar__view-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}
