/* ==============================================
   CALENDAR DAYS
   ============================================== */

/* === UNIFIED 8-COLUMN GRID === */

.calendar-grid-unified {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    gap: 8px;
    row-gap: 9px;
    padding-top: 4px;
    background: transparent;
}

/* === MONTH LABELS === */

.month-label-inline {
    grid-column: 1;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.08em;
    background: transparent;
    padding: 0.5rem 0.15rem;
    font-family: var(--font-hull);
    font-weight: 700;
    font-size: 1.4rem;
    text-transform: uppercase;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    border-right: 2px solid #e0e0e0;
    line-height: normal;
    gap: 0.5rem;
}

.month-label-inline .month-name {
    font-weight: 700;
    font-size: 1.4rem;
    color: #666;
}

.month-label-inline .year-label {
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.5;
    letter-spacing: 0.05em;
}

/* Naprzemienne tła miesięcy */
.calendar-day.month-even {
    background: #fff;
    outline: 4px solid #e3f2fd;
}
.calendar-day.month-odd {
    background: #fff;
    outline: 4px solid #fff3e0;
}
.month-label-inline.month-even {
    border-right-color: #1976d2;
    background: #e3f2fd;
}
.month-label-inline.month-odd {
    border-right-color: #e65100;
    background: #fff3e0;
}



.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-hull);
    font-size: 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-weight: 500;
    border: none;
}

.calendar-day:hover {
    z-index: 100;
}

.calendar-day.empty {
    cursor: default;
}

/* === STANY DNI KALENDARZA === */

.calendar-day.available {
    background: #fff;
    color: #000;
    border: 0.25px solid #4caf50;
    position: relative;
    box-shadow: none;
}

.calendar-day .day-number {
    position: absolute;
    top: 3px;
    left: 4px;
    font-size: 0.85rem;
    font-weight: 300;
    color: #999;
    pointer-events: none;
    z-index: 1;
}

.calendar-day.available .day-number {
    font-size: 0.85rem;
    font-weight: 300;
    color: #555;
}

.calendar-day .day-price {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.95rem;
    font-weight: 300;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #ccc;
    padding: 1px 5px;
    line-height: 1.2;
    border-radius: 3px;
    z-index: 2;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.calendar-day.available:hover {
    border-color: #2e7d32;
    box-shadow: 0 0 0 1px #2e7d32;
    transform: scale(1.05);
}

.calendar-day.closed {
    background: #faf5f4;
    color: #ccc;
    border: 0.25px solid #e0e0e0;
    cursor: not-allowed;
}
.calendar-day.closed.month-even { background: #f0f7fd; }
.calendar-day.closed.month-odd { background: #fff8f0; }

.calendar-day.closed::after {
    content: '\00d7';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 300;
    color: #ddd;
    pointer-events: none;
    line-height: 1;
}

.calendar-day.checkout-only {
    background: #fff;
    color: #000;
    border: 0.25px solid #4caf50;
    border-right-color: #e0e0e0;
    border-bottom-color: #e0e0e0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    overflow: hidden;
}

.calendar-day.checkout-only::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #faf5f4;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    pointer-events: none;
    z-index: 0;
}
.calendar-day.checkout-only.month-even::after { background: #f0f7fd; }
.calendar-day.checkout-only.month-odd::after { background: #fff8f0; }

.calendar-day.checkout-only::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top left,
        transparent calc(50% - 0.25px),
        #4caf50 calc(50% - 0.25px),
        #4caf50 calc(50% + 0.25px),
        transparent calc(50% + 0.25px)
    );
    pointer-events: none;
    z-index: 2;
}

.calendar-day.checkout-only:hover {
    border-color: #1B5E20;
    box-shadow: 0 0 0 1px #1B5E20;
    transform: scale(1.05);
}

.calendar-day.available.after-co {
    position: relative;
    overflow: hidden;
    border: 0.25px solid #4caf50;
    border-top-color: #e0e0e0;
    border-left-color: #e0e0e0;
}

.calendar-day.available.after-co::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #faf5f4;
    clip-path: polygon(0 0, 0 100%, 100% 0);
    z-index: 0;
    pointer-events: none;
}
.calendar-day.available.after-co.month-even::before { background: #f0f7fd; }
.calendar-day.available.after-co.month-odd::before { background: #fff8f0; }

.calendar-day.available.after-co::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to top left,
        transparent calc(50% - 0.25px),
        #4caf50 calc(50% - 0.25px),
        #4caf50 calc(50% + 0.25px),
        transparent calc(50% + 0.25px)
    );
    pointer-events: none;
    z-index: 2;
}

/* === DNI PROMOCYJNE === */

.calendar-day.promo {
    background: #fff;
    color: #000;
    border: 0.25px solid #FFB74D;
    position: relative;
}

.calendar-day.promo .day-number {
    position: absolute;
    top: 3px;
    left: 4px;
    font-size: 0.85rem;
    font-weight: 400;
    color: #757575;
}

.calendar-day.promo .day-price {
    font-size: 1.1rem;
    font-weight: 500;
    color: #E65100;
    position: absolute;
    bottom: 2px;
    right: 4px;
}

.calendar-day.promo:hover {
    box-shadow: 0 0 0 2px #1B5E20;
    transform: scale(1.05);
}



/* Styl dla numerów dni — nadpisania per stan */
.calendar-day.closed .day-number,
.calendar-day.past .day-number {
    color: #ccc;
    z-index: 4;
}

.calendar-day.past {
    background: #faf5f4;
    color: #ccc;
    border: 0.25px solid #e0e0e0;
    cursor: not-allowed;
}
.calendar-day.past.month-even { background: #f0f7fd; }
.calendar-day.past.month-odd { background: #fff8f0; }

.calendar-day.past::after {
    content: '\00d7';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 300;
    color: #ddd;
    pointer-events: none;
    line-height: 1;
}

.calendar-day.checkout-only .day-number {
    color: #666;
}



/* === POZOSTAŁE STANY DNI === */

.calendar-day.today {
    font-weight: 700;
}

.calendar-day.selected-start,
.calendar-day.selected-end {
    background: #c8e6c9 !important;
    color: #333 !important;
    font-weight: 700;
}

.calendar-day.checkout-only.selected-end {
    background: linear-gradient(135deg, #c8e6c9 0%, #c8e6c9 50%, #faf5f4 50%, #faf5f4 100%) !important;
}

.calendar-day.in-range {
    background: #c8e6c9 !important;
    color: #333 !important;
}

.calendar-day.hover-preview {
    background: #e8f5e9 !important;
    color: #333 !important;
}

@keyframes pulse-blocked {
    0%, 100% { background: #ffcdd2; box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.4); }
    50% { background: #ef5350; box-shadow: 0 0 0 6px rgba(198, 40, 40, 0); }
}

.calendar-day.hover-blocked {
    background: #ffcdd2 !important;
    color: #c62828 !important;
    border-color: #ef9a9a !important;
    z-index: 50;
    animation: pulse-blocked 1s ease-in-out infinite;
}
