/* WAB Advent Calendar - Frontend Styles */

.wab-advent-calendar-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    position: relative;
}

/* Show decorative header only in shortcode mode (not Elementor) */
.wab-advent-calendar-wrapper:not(.wab-elementor-widget)::before {
    content: '🎄 ⭐ ❄️ 🎁 ⭐ ❄️ 🎄';
    display: block;
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 10px;
    animation: lightsFlicker 2s ease-in-out infinite;
}

/* Elementor widget wrapper - no default padding/max-width/background */
.wab-advent-calendar-wrapper.wab-elementor-widget {
    max-width: 100%;
    padding: 0;
    margin: 0;
    background: none !important;
}

@keyframes lightsFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Test Mode Banner */
.wab-test-mode-banner {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    padding: 15px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1em;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

.wab-advent-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.wab-advent-header h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #c41e3a;
    text-shadow: 2px 2px 4px rgba(196, 30, 58, 0.2);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 2px 2px 4px rgba(196, 30, 58, 0.2), 0 0 10px rgba(196, 30, 58, 0.1);
    }
    50% {
        text-shadow: 2px 2px 4px rgba(196, 30, 58, 0.4), 0 0 20px rgba(196, 30, 58, 0.2);
    }
}

.wab-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    color: #856404;
}

/* Hide global shortcode heading inside Elementor; progress header stays visible */
.wab-elementor-widget .wab-advent-header {
    display: none;
}

/* Emoji Progress Section */
.wab-emoji-progress {
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 24px;
}


/* Default styles for shortcode version only */
.wab-advent-calendar-wrapper:not(.wab-elementor-widget) .wab-emoji-progress {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wab-emoji-progress h3 {
    margin: 0 0 10px 0;
    color: #2c5f2d;
    text-align: center;
    font-size: 1.8em;
}

.wab-collection-intro {
    text-align: center;
    color: #666;
    margin: 0 0 20px 0;
    font-size: 1em;
}

.wab-emoji-sets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 0;
}

.wab-emoji-set {
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Default styles for shortcode version only */
.wab-advent-calendar-wrapper:not(.wab-elementor-widget) .wab-emoji-set {
    background: white;
    border: 3px solid #dee2e6;
}

.wab-emoji-set::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    transition: all 0.3s ease;
}

/* Hide the top border accent in Elementor widget */
.wab-elementor-widget .wab-emoji-set::before {
    display: none;
}

.wab-emoji-set.complete {
    transform: scale(1.02);
}

/* Default complete styles for shortcode version only */
.wab-advent-calendar-wrapper:not(.wab-elementor-widget) .wab-emoji-set.complete {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.wab-emoji-set.complete::before {
    background: linear-gradient(90deg, #28a745, #1e7e34);
    height: 5px;
}

.wab-set-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.wab-set-name {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.wab-set-emoji {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    position: relative;
    flex-shrink: 0;
}

.wab-emoji-set.complete .wab-set-emoji::after {
    content: '✓';
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #198754;
    color: #fff;
    font-size: 0.65em;
    border-radius: 999px;
    padding: 4px;
    border: 2px solid #fff;
}

.wab-set-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.wab-set-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wab-set-message {
    font-size: 0.95em;
    font-weight: 500;
    color: #495057;
    margin: 0;
}

.wab-set-prize-note {
    margin-top: 6px;
    color: #495057;
    font-size: 0.95em;
    font-weight: 500;
}

.wab-set-counter {
    background: #f1f3f5;
    color: #495057;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    min-width: 78px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.wab-set-counter.complete {
    background: #d1fae5;
    color: #065f46;
}

.wab-progress-meta {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wab-emoji-set.complete .wab-set-message {
    color: #166534;
}

.wab-emoji-set.complete .wab-set-prize-note {
    color: #14532d;
    font-weight: 600;
}

.wab-emoji-set.complete .wab-progress-meta {
    color: #14532d;
}


.wab-progress-bar {
    background: #e9ecef;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 14px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
}

.wab-progress-fill {
    background: linear-gradient(90deg, #007bff, #0056b3);
    height: 100%;
    transition: width 0.6s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    border-radius: inherit;
}

.wab-progress-text {
    color: #ffffff;
    font-size: 0.75em;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.wab-emoji-set.complete .wab-progress-fill {
    background: linear-gradient(90deg, #28a745, #1e7e34);
}

/* Prize Display */


/* Calendar Grid */
.wab-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
}


.wab-door {
    aspect-ratio: 1;
    border: 3px solid #8b4513;
    border-radius: 10px;
    background: linear-gradient(135deg, #d4af37 0%, #c9a227 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 8px;
    box-sizing: border-box;
}

.wab-door::before {
    content: '❄️';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 1.2em;
    opacity: 0.3;
}

.wab-door::after {
    content: '❄️';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.2em;
    opacity: 0.3;
}

.wab-door-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.wab-door.available:hover .wab-door-number {
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.wab-door.opened {
    background: linear-gradient(135deg, #2c5f2d 0%, #1e4620 100%);
    border-color: #28a745;
}

.wab-door.available {
    background: linear-gradient(135deg, #c41e3a 0%, #a01729 100%);
    animation: christmasGlow 2s ease-in-out infinite;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.4);
}

.wab-door.available:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.6), 0 0 30px rgba(255, 215, 0, 0.4);
    animation: jingleBell 0.5s ease;
}

@keyframes christmasGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(196, 30, 58, 0.4), 0 0 5px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(196, 30, 58, 0.6), 0 0 15px rgba(255, 215, 0, 0.4);
    }
}

@keyframes jingleBell {
    0%, 100% { transform: scale(1.05) rotate(0deg); }
    25% { transform: scale(1.05) rotate(-5deg); }
    75% { transform: scale(1.05) rotate(5deg); }
}

.wab-door.locked {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border-color: #495057;
    cursor: not-allowed;
    opacity: 0.7;
}

.wab-door.missed {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
    border-color: #c82333;
    opacity: 0.6;
    color: #fff;
}

.wab-door-bonus {
    grid-column: span 2;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 4px solid #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.wab-door-emoji {
    font-size: 2.5em;
    margin: 5px 0;
    line-height: 1;
}

.wab-door-set {
    font-size: 0.75em;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.wab-door-action {
    width: 100%;
    padding: 10px;
}

.wab-open-door-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    background: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
    color: #c41e3a;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.wab-open-door-btn:hover {
    background: #c41e3a;
    color: #fff;
    transform: scale(1.05);
}

.wab-door-locked,
.wab-door-missed {
    font-size: 2em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wab-door-surprise-icon {
    font-size: 2.5em;
    margin: 5px 0;
    line-height: 1;
}

.wab-door-surprise-label {
    font-size: 0.75em;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

/* Modal */
.wab-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(3px);
}

.wab-modal::before {
    content: '❄️ ⭐ ✨ 🎁 ❄️ 🎄 ⭐ ✨ ❄️';
    position: absolute;
    top: 10%;
    left: 0;
    right: 0;
    font-size: 2em;
    opacity: 0.3;
    text-align: center;
    animation: snowFloat 6s ease-in-out infinite;
    pointer-events: none;
}

.wab-modal::after {
    content: '🎁 ✨ ⭐ 🎄 ❄️ ⭐ 🎁 ✨ ❄️';
    position: absolute;
    bottom: 10%;
    left: 0;
    right: 0;
    font-size: 2em;
    opacity: 0.3;
    text-align: center;
    animation: snowFloat 6s ease-in-out infinite 1s;
    pointer-events: none;
}

.wab-modal-content {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 450px;
    animation: modalBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3), 0 0 0 3px #c41e3a, 0 0 0 6px #2c5f2d;
    position: relative;
    overflow: hidden;
}

.wab-modal-content::before {
    content: '🎄';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 2em;
    animation: sway 3s ease-in-out infinite;
}

.wab-modal-content::after {
    content: '🎄';
    position: absolute;
    top: -10px;
    right: 10px;
    font-size: 2em;
    animation: sway 3s ease-in-out infinite 0.5s;
}

.wab-modal-emoji {
    font-size: 7em;
    margin-bottom: 20px;
    animation: emojiCelebration 0.8s ease;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    position: relative;
}

.wab-modal-message {
    font-size: 1.4em;
    margin-bottom: 25px;
    color: #2c5f2d;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: messageSlideUp 0.6s ease 0.3s both;
}

.wab-modal-close {
    background: linear-gradient(135deg, #c41e3a 0%, #a01729 100%);
    color: white;
    border: 3px solid #fff;
    padding: 14px 35px;
    border-radius: 25px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wab-modal-close:hover {
    background: linear-gradient(135deg, #2c5f2d 0%, #1e4620 100%);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(44, 95, 45, 0.4);
}

@keyframes modalBounceIn {
    0% {
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    70% {
        transform: scale(0.95) rotate(-1deg);
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes emojiCelebration {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
    }
    75% {
        transform: scale(0.9) rotate(340deg);
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

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

@keyframes snowFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

@keyframes sway {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(10deg);
    }
}

/* Surprise Modal Styles */
.wab-surprise-modal {
    text-align: center;
}

.wab-surprise-modal h2 {
    color: #c41e3a;
    margin: 0 0 25px 0;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(196, 30, 58, 0.2);
    animation: messageSlideUp 0.5s ease;
}

.wab-surprise-image {
    margin: 20px 0;
}

.wab-surprise-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wab-surprise-coupon {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.wab-coupon-code {
    font-size: 2em;
    font-weight: bold;
    color: #c41e3a;
    background: white;
    padding: 15px 30px;
    border: 3px dashed #c41e3a;
    border-radius: 8px;
    margin: 15px 0;
    font-family: monospace;
    letter-spacing: 2px;
}

.wab-copy-coupon {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.wab-copy-coupon:hover {
    background: #0056b3;
}

.wab-surprise-message,
.wab-surprise-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.2em;
    line-height: 1.6;
}

.wab-surprise-link {
    margin: 20px 0;
}

.wab-surprise-btn {
    display: inline-block;
    background: #28a745;
    color: white;
    text-decoration: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.wab-surprise-btn:hover {
    background: #218838;
    transform: scale(1.05);
    color: white;
}

.wab-copy-notification {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wab-summary-pill {
        width: 100%;
    }

    .wab-calendar-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .wab-bonus-door-card {
        grid-column: 1 / -1;
    }
    
    .wab-door-number {
        font-size: 1.1em;
    }
    
    .wab-door-emoji {
        font-size: 1.8em;
    }
    
    .wab-door-surprise-icon {
        font-size: 1.8em;
    }
    
    .wab-door-set,
    .wab-door-surprise-label {
        font-size: 0.65em;
        padding: 3px 6px;
    }
    
    .wab-advent-header h2 {
        font-size: 1.8em;
    }
    
    .wab-emoji-progress {
        padding: 14px;
    }

    .wab-emoji-progress h3 {
        font-size: 1.3em;
    }
    
    .wab-emoji-sets {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .wab-emoji-set {
        padding: 12px;
    }
    
    .wab-set-header strong {
        font-size: 1em;
    }
    
    .wab-set-counter {
        font-size: 1em;
        padding: 5px 12px;
    }
}

/* Festive confetti effect */
.wab-particle {
    will-change: transform, opacity;
}

/* Add sparkle effect to opened doors */
.wab-door.opened::before,
.wab-door.opened::after {
    content: '✨';
    opacity: 0.8;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Christmas lights animation on bonus door */
.wab-door-bonus::before,
.wab-door-bonus::after {
    content: '💡';
    animation: lightsColor 1.5s ease-in-out infinite;
}

@keyframes lightsColor {
    0%, 100% { filter: hue-rotate(0deg); }
    33% { filter: hue-rotate(120deg); }
    66% { filter: hue-rotate(240deg); }
}
