@import url('https://fonts.googleapis.com/css2?family=Parisienne&display=swap');

.advent-calendar-header, .advent-calendar-container, .overlay {
    font-family: 'Parisienne', cursive, 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}
.advent-calendar-container { padding: 0px; max-width: 1200px; margin: 0 auto; }

.advent-calendar-title { color: #333; margin-bottom: 60px; text-align: center; font-size: 40px; line-height: 44px; font-weight: 600; }
.categories-grid .category-title { gap: 14px; margin-bottom: 10px; padding-right: 40px; display: flex; align-items: center; }
.categories-grid .category-title .cat-card-name { font-weight: bold; font-size: 20px; line-height: 20px; }
.categories-grid .cat-card-desc { font-weight: 200; font-size: 18px; line-height: 18px; }
.advent-calendar-header .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: 100%; display: grid; margin-bottom: 40px; }
@media (max-width: 768px) {
    .advent-calendar-header .categories-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) }
}

.current-day-btn {
    display: block;
    margin: 0 auto 40px auto;
    background: #d0ae05;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 21px;
    font-weight: normal;
    font-family: 'Parisienne', cursive, 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    transition: background 0.3s, transform 0.2s;
    outline: none;
}

.current-day-btn:hover {
    background: #aa921f;
    transform: translateY(-2px);
}

.current-day-btn:active {
    transform: translateY(0);
}

.category-card .cat-card-picto {
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}


.advent-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-width: 100%;
}

@media (min-width: 768px) {
    .advent-calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.advent-card { aspect-ratio: 0.8; perspective: 1000px; cursor: pointer; border-radius: 8px; }


.pulsing-card { animation: card-pulse-glow 2s infinite ease-in-out; }
@keyframes card-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 18px 4px rgba(208, 174, 6, 1);
  }
  50% {
    box-shadow: 0 0 28px 9px rgba(208, 174, 6, 0);
  }
}

.advent-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.3s;
    transform-style: preserve-3d;
}
.advent-card-inner:hover { transform: rotate(-1deg); }

.advent-card.flipped .advent-card-inner {
    transform: rotateY(180deg);
}

.advent-card-front,
.advent-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.advent-card-back {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: rotateY(180deg);
}

.advent-card-front {
    background: linear-gradient(145deg, #233161 60%, #1a213a 100%); border: none; color: #d0ae06;
}
.advent-card-front:after { border-radius: 5px; border: 1px solid #d0ae06; top: 8px; left: 8px; width: calc(100% - 17px); height: calc(100% - 17px); content: ""; position: absolute; }

.advent-card-returned { background: linear-gradient(145deg, #24387d 34%, #1a213a 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; gap: 24px; text-align: center; }
.advent-card-returned .category-name { color: #d0ae06; }

.card-day { font-size: 30px; font-weight: normal; margin-bottom: 10px; }

.card-category-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.advent-card-front .category-picto { position: absolute; left: 18px; top: 18px; }
.advent-card-front .category-picto:not(:first-child) { right: 18px; bottom: 18px; left: initial; top: initial; }
.advent-card-front .category-picto { width: 36px; height: 36px; }
@media (min-width: 768px) {
    .advent-card-front .category-picto {
        width: 30px; height: 30px;
    }
}

.category-picto {
    width: 40px;
    height: 40px;
    margin-bottom: 0px;
    background-position: center center; background-size: contain; background-repeat: no-repeat; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; mask-size: contain; mask-repeat: no-repeat; mask-position: center center;
}

/* Category picto SVGs with colors */
.category-picto-cat1 {
    /*background-color: #d0ae06;*/
    /*-webkit-mask-image: url('img/cat1.svg');
    mask-image: url('img/cat1.svg');*/
}

.category-picto-cat2 {
    /*background-color: #d0ae06;*/
    /*-webkit-mask-image: url('img/cat2.svg');
    mask-image: url('img/cat2.svg');*/
}

.category-picto-cat3 {
    /*background-color: #d0ae06;*/
    /*-webkit-mask-image: url('img/cat3.svg');
    mask-image: url('img/cat3.svg');*/
}

.category-picto-cat4 {
    /*background-color: #d0ae06;*/
    /*-webkit-mask-image: url('img/cat4.svg');
    mask-image: url('img/cat4.svg');*/
}

.category-picto-cat5 {
    /*background-color: #d0ae06;*/
    /*-webkit-mask-image: url('img/cat5.svg');
    mask-image: url('img/cat5.svg');*/
    mask-size: 100%;
}

.category-name { font-size: 22px; font-weight: 600; }

.returned-card-title { color: #fff; font-size: 34px; font-weight: 600; text-align: center; margin: 10px 0; }

.show-overlay-btn { background: #d0ae05; color: #fff; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 14px; font-weight: normal; transition: background 0.3s; outline: none; }
.show-overlay-btn:hover { background: #aa921f; }

/* Overlay Styles */
.overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    box-sizing: border-box;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.overlay.active .overlay-content {
    transform: scale(1);
    opacity: 1;
}

.overlay-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    font-family: monospace;
}

.overlay-close:hover {
    background: #e0e0e0;
}

.overlay-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-right: 40px;
}

.overlay-category-picto {
    width: 30px;
    height: 30px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.overlay-category-name { font-size: 22px; font-weight: 600; color: #333; }
.overlay-category-name > span { display: block; }
.overlay-category-name .ocat-desc { font-size: 16px; line-height: 14px; font-weight: normal; margin-top: 4px; }
.overlay-title { font-size: 28px; font-weight: bold; margin-bottom: 14px; color: #233161; }
.overlay-text { font-size: 20px; color: #333; margin-bottom: 20px; line-height: 22px; font-weight: 200; }
.overlay-text b { font-weight: bold; }
.overlay-content a { color: #233161; }


.overlay-content[attr-day="25"] .overlay-category-name { display: none; }

.overlay-image {
    width: 100%;
    /*max-height: 300px;*/
    /*object-fit: cover;*/
    /*border-radius: 8px;*/
    /*margin-bottom: 20px;*/
}

.overlay-content .image-container { display: block; position: relative; margin-bottom: 16px; }
.overlay-content .image-container .image-copyright { position: absolute; right: 0px; bottom: -22px; font-family: sans-serif; font-size: 8px; color: #333333; text-align: right; min-height: 27px; }

.overlay-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.overlay-link:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* Category Colors */
.category-cat1 { color: #FF6B6B; }
.category-cat2 { color: #4ECDC4; }
.category-cat3 { color: #45B7D1; }
.category-cat4 { color: #FFA07A; }
.category-cat5 { color: #98D8C8; }

.category-bg-cat1 { background-color: #FF6B6B; }
.category-bg-cat2 { background-color: #4ECDC4; }
.category-bg-cat3 { background-color: #45B7D1; }
.category-bg-cat4 { background-color: #FFA07A; }
.category-bg-cat5 { background-color: #98D8C8; }


/* Firework Effect */
.firework {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2000;
    transform: translate(-50%, -50%);
}

.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: firework-particle 1.5s ease-out forwards;
}

@keyframes firework-particle {
    0% {
        transform: translate(-50%, -50%) translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}




/* wordpress specific */
.wp-singular .overlay { align-items: self-end; }
.wp-singular .overlay-content { max-height: calc(90vh - 90px); }
.wp-singular .advent-card-returned { gap: 4px; }

@media (max-width: 1024px) {
    .wp-singular .overlay { align-items: center; }
    .wp-singular .advent-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 728px) {
    .wp-singular .advent-calendar-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}
