/* ===========================
   ADVENT PAGE ISOLATION
=========================== */

.advent-page {
    --otm-blue-dark: #15347e;
    --otm-red: #f22737;
    --otm-blue-light: #0095ea;
    --otm-yellow: #ffdb00;
    --otm-light-bg: #e8f1f4;

    --radius: 12px;

    font-family: inherit;
    background: var(--otm-light-bg);
    padding: 20px 10px;
    position: relative;
}

/* Wrapper */
.advent-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    margin-top: 100px;
}

/* Header */
.advent-header {
    background: var(--otm-blue-dark);
    color: white;
    text-align: center;
    padding: 25px 10px;
    border-radius: var(--radius);
    border: 4px solid var(--otm-yellow);
    transform: rotate(-1deg);
    margin-bottom: 30px;
}

.advent-header__title {
    font-size: 32px;
    font-weight: 900;
}

.advent-header__logo {
    display: block;
    margin: 10px auto 0;
    max-width: 240px;
}

.advent-header__subtitle {
    margin-top: 10px;
    font-size: 18px;
}

/* Calendar Grid */
.advent-calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Day Cells */
.advent-calendar-grid .calendar-day {
    background: var(--otm-blue-light);
    border: 2px solid var(--otm-yellow);
    border-radius: var(--radius);
    color: white;
    font-weight: 700;
    height: 150px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    position: relative;
    cursor: pointer;
    transition: transform .25s ease;
}

.calendar-day:hover {
    transform: scale(1.05);
}

.calendar-day.open {
    background: #f8f4e3 !important;
    color: #333 !important;
}

.calendar-day.special {
    background: var(--otm-blue-dark);
    color: var(--otm-yellow);
    border-width: 4px;
}

.calendar-day.good {
    background: var(--otm-red);
    border-width: 2px;
}

.calendar-day.future {
    filter: grayscale(75%) brightness(.7);
    cursor: not-allowed;
}

/* Tooltip */
.calendar-day.future:hover::after {
    content: "Повертайся завтра та виконуй нове завдання!";
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;

    background: var(--otm-blue-dark);
    color: white;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 13px;

    opacity: 0;
    animation: fadeUp .25s forwards;
    z-index: 100;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translate(-50%, 5px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Icons */
.otamanko-icon {
    width: 40px;
    height: 40px;
    position: absolute;
    bottom: -6px;
    right: -6px;
    opacity: 1;
    transform: rotate(5deg);
}

/* Modal */
.advent-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transition: .3s;
    z-index: 10000;
}

.advent-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.advent-modal__content {
    background: white;
    max-width: 380px;
    padding: 25px;
    border-radius: var(--radius);
    border-top: 8px solid var(--otm-red);
    animation: pop .3s ease;
}

@keyframes pop {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* Modal elements */
.advent-modal__header {
    display: flex;
    justify-content: space-between;
}

.advent-modal__title {
    font-size: 22px;
    font-weight: 800;
    color: var(--otm-red);
}

.advent-modal__close {
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}

.advent-modal__task {
    margin: 20px 0;
    font-size: 17px;
}

.advent-modal__hint {
    border-left: 4px solid var(--otm-yellow);
    padding-left: 10px;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 20px;
}

.advent-modal__button {
    width: 100%;
    background: var(--otm-red);
    color: white;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: bold;
}

/* Snow */
.advent-snow-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 999;
}

.advent-snow {
    position: absolute;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    pointer-events: none;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    0% { transform: translateY(-10vh) translateX(0); }
    100% { transform: translateY(110vh) translateX(20px); }
}

@media (max-width: 768px) {
    .advent-calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .calendar-day.future:hover::after {
        white-space: wrap;
    }

}@media (max-width: 480px) {
    .advent-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .advent-modal__content {
        max-width: 300px;
    }

    .advent-modal__task {
        font-size: 15px;
    }

    .calendar-day.future:hover::after {
        width: 200px;
    }
}

.advent-instruction {
    margin: 30px 0;
    text-align: justify;
}

.advent-loader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .4s ease;
}

.advent-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.advent-loader__inner {
    text-align: center;
    animation: fadeIn .6s ease both;
}

.advent-loader__logo {
    width: 120px;
    height: auto;
    animation: pulse 1.4s ease-in-out infinite;
}

.advent-loader__text {
    margin-top: 12px;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    animation: blink 1.6s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}
@keyframes blink {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.placeholder-day {
    opacity: 0;
    visibility: hidden;
}

@media (max-width: 768px) {
  #day-25.last-day {
    grid-column: span 3;
  }
}

@media (max-width: 480px) {
    #day-25.last-day {
        grid-column: span 2;
    }
}

.advent-modal__subtitle {
  font-weight: 600;
  margin-bottom: 8px;
  color: #15347e;
  text-transform: uppercase;
}

p, li, h4 {
    margin-bottom: 10px;
}