@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&family=Mountains+of+Christmas:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: url('img.jpg') center center fixed;
    background-size: cover;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(0, 80, 0, 0.5) 0%, rgba(0, 60, 0, 0.6) 100%),
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

h1 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 4.5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 
        0 0 10px rgba(255,215,0,0.8),
        0 0 20px rgba(255,215,0,0.6),
        0 4px 20px rgba(0,0,0,0.5),
        2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 3px;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow: 
            0 0 10px rgba(255,215,0,0.8),
            0 0 20px rgba(255,215,0,0.6),
            0 4px 20px rgba(0,0,0,0.5);
    }
    100% {
        text-shadow: 
            0 0 20px rgba(255,215,0,1),
            0 0 30px rgba(255,215,0,0.8),
            0 0 40px rgba(255,215,0,0.6),
            0 4px 20px rgba(0,0,0,0.5);
    }
}

.subtitle {
    text-align: center;
    color: rgba(255,255,255,0.95);
    font-size: 1.4rem;
    margin-bottom: 40px;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

#mainBlock {
    background: linear-gradient(135deg, rgba(0, 80, 0, 0.3) 0%, rgba(0, 60, 0, 0.35) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 40px 50px;
    margin-bottom: 40px;
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.2) inset,
        0 0 30px rgba(255,215,0,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

#mainBlock::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#mainBlockInner {
    max-width: 1300px;
    margin: 0 auto;
    /*padding: 20px;*/
}

/* Advent Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 120px));
    gap: 15px;
    margin-top: 40px;
    padding: 20px;
    justify-content: center;
}

@media (min-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(6, 120px);
        justify-content: center;
    }
}

/* Advent Window Styles */
.window {
    aspect-ratio: 1;
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.15) 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,0.4);
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.2) inset;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.window::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.window:hover::before {
    left: 100%;
}

.window::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.window:hover::after {
    width: 200%;
    height: 200%;
}

.window:hover {
    transform: translateY(-8px) scale(1.08) rotate(2deg);
    box-shadow: 
        0 15px 35px rgba(0,0,0,0.4),
        0 0 30px rgba(255,215,0,0.5),
        0 0 0 2px rgba(255,255,255,0.5) inset;
    border-color: rgba(255,255,255,0.7);
}

.window:active {
    transform: translateY(-4px) scale(1.04);
}

.window span {
    position: relative;
    z-index: 2;
    text-shadow: 
        0 2px 10px rgba(0,0,0,0.5),
        0 0 20px rgba(255,255,255,0.3);
    transition: transform 0.3s;
}

.window:hover span {
    transform: scale(1.1);
}

/* Opened window (after today) - OTEVŘENÁ DVÍŘKA */
.window.after {
    background: linear-gradient(135deg, #d4a574 0%, #c9a068 100%);
    cursor: pointer;
    border-color: rgba(139, 69, 19, 0.5);
    position: relative;
    overflow: hidden;
    perspective: 800px;
    transform-style: preserve-3d;
}

/* Levé dvířko - otevřené doleva */
.window.after::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: 
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent 2px, 
            rgba(0,0,0,0.05) 2px, 
            rgba(0,0,0,0.05) 4px),
        linear-gradient(135deg, #8b4513 0%, #a0522d 50%, #cd853f 100%);
    border-radius: 15px 0 0 15px;
    transform-origin: left center;
    transform: rotateY(-70deg);
    transition: transform 0.4s ease-out;
    box-shadow: 
        -5px 0 15px rgba(0,0,0,0.5),
        inset -3px 0 8px rgba(0,0,0,0.3);
    border-right: 3px solid rgba(101, 67, 33, 0.8);
    z-index: 1;
}

/* Pravé dvířko - otevřené doprava */
.window.after::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: 
        repeating-linear-gradient(90deg, 
            transparent, 
            transparent 2px, 
            rgba(0,0,0,0.05) 2px, 
            rgba(0,0,0,0.05) 4px),
        linear-gradient(135deg, #8b4513 0%, #a0522d 50%, #cd853f 100%);
    border-radius: 0 15px 15px 0;
    transform-origin: right center;
    transform: rotateY(70deg);
    transition: transform 0.4s ease-out;
    box-shadow: 
        5px 0 15px rgba(0,0,0,0.5),
        inset 3px 0 8px rgba(0,0,0,0.3);
    border-left: 3px solid rgba(101, 67, 33, 0.8);
    z-index: 1;
}

/* Vnitřní obsah - odhalený po otevření */
.window.after span {
    color: #fff;
    text-shadow: 
        0 2px 8px rgba(0,0,0,0.6),
        0 0 15px rgba(255,215,0,0.4);
    font-weight: 800;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, rgba(0,80,0,0.9) 0%, rgba(0,60,0,0.9) 100%);
    width: 70%;
    height: 70%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 2px 5px rgba(0,0,0,0.3),
        0 2px 10px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,215,0,0.5);
    animation: revealContent 0.6s ease-out 0.3s both;
}

@keyframes revealContent {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hover efekt - dvířka se více otevřou a okénko se mírně zvedne */
.window.after:hover {
    transform: translateY(-3px);
}

.window.after:hover::before {
    transform: rotateY(-85deg);
}

.window.after:hover::after {
    transform: rotateY(85deg);
}

.window.after:hover span {
    transform: scale(1.1);
    box-shadow: 
        inset 0 2px 5px rgba(0,0,0,0.3),
        0 4px 15px rgba(255,215,0,0.6);
}


/* Today's window - ČISTÝ MODERNÍ DESIGN */
.window.today {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(0, 100, 0, 0.3) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        0 8px 30px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
    animation: subtlePulse 3s ease-in-out infinite;
}

.window.today::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    animation: shine 4s ease-in-out infinite;
    z-index: 1;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 
            0 0 0 1px rgba(255, 255, 255, 0.3) inset,
            0 8px 30px rgba(0, 0, 0, 0.3),
            0 0 50px rgba(255, 215, 0, 0.4);
    }
    50% {
        box-shadow: 
            0 0 0 2px rgba(255, 255, 255, 0.4) inset,
            0 10px 35px rgba(0, 0, 0, 0.4),
            0 0 70px rgba(255, 215, 0, 0.6);
    }
}

.window.today::after {
    display: none;
}

.window.today span {
    position: relative;
    z-index: 2;
    color: #fff;
    font-weight: 900;
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.6);
}

.window.today:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.5) inset,
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(255, 215, 0, 0.6);
}

.window.today:hover span {
    transform: scale(1.1);
}

/* Locked window (future) */
.window.soon {
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    cursor: not-allowed;
    opacity: 0.7;
    position: relative;
    border-color: rgba(255,255,255,0.2);
}

.window.soon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,0.1) 10px,
        rgba(0,0,0,0.1) 20px
    );
    z-index: 1;
}

.window.soon::after {
    content: '🔒';
    position: absolute;
    bottom: 8px;
    right: 8px;
    transform: rotate(0deg);
    font-size: 1.8rem;
    opacity: 0.8;
    z-index: 2;
    width: auto;
    height: auto;
    background: none;
    animation: lockShake 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

@keyframes lockShake {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(-8deg) scale(1.1);
    }
    75% {
        transform: rotate(8deg) scale(1.1);
    }
}

.window.soon:hover {
    transform: none;
    box-shadow: 
        0 8px 20px rgba(0,0,0,0.3),
        0 0 0 1px rgba(255,255,255,0.2) inset;
}

/* Math Problem Display */
.math-problem-container {
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.95) 100%);
    border-radius: 25px;
    padding: 50px;
    margin: 30px auto;
    max-width: 900px;
    box-shadow: 
        0 15px 50px rgba(0,0,0,0.3),
        0 0 0 2px rgba(0,80,0,0.2) inset;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
    border: 3px solid rgba(0,80,0,0.3);
    position: relative;
    overflow: hidden;
}

.math-problem-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
        background: radial-gradient(circle, rgba(0,80,0,0.05) 0%, transparent 70%);
    animation: rotateSlow 15s linear infinite;
}

@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.math-problem-container h2 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5rem;
    color: #1a5a3f;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.math-problem-container img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.2),
        0 0 0 2px rgba(0,80,0,0.1) inset;
    margin: 20px 0;
    transition: transform 0.3s;
}

.math-problem-container img:hover {
    transform: scale(1.02);
}

.back-button {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 40px;
    background: linear-gradient(135deg, #1a5a3f 0%, #0d3d26 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 
        0 6px 20px rgba(0,100,0,0.4),
        0 0 0 1px rgba(255,255,255,0.2) inset;
    border: 2px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.back-button:hover::before {
    left: 100%;
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0,100,0,0.6),
        0 0 30px rgba(0,100,0,0.4),
        0 0 0 1px rgba(255,255,255,0.3) inset;
    color: #fff;
    text-decoration: none;
}

.back-button:active {
    transform: translateY(-1px);
}

/* Snowflake Animation */
.snowflake {
    position: fixed;
    color: rgba(255,255,255,0.9);
    font-size: 1.8em;
    text-shadow: 
        0 0 5px rgba(255,255,255,0.8),
        0 0 10px rgba(255,255,255,0.5);
    animation: snowfall linear infinite;
    pointer-events: none;
    z-index: 0;
}

/* Matematické vzorce - speciální styling */
.snowflake.math-formula {
    font-family: 'Courier New', 'Times New Roman', serif;
    font-weight: 600;
    color: rgba(255, 215, 0, 0.95);
    text-shadow: 
        0 0 8px rgba(255, 215, 0, 0.8),
        0 0 15px rgba(255, 215, 0, 0.6),
        0 2px 5px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 8px;
    border-radius: 5px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 
        0 0 10px rgba(255, 215, 0, 0.4),
        inset 0 0 5px rgba(255, 255, 255, 0.2);
    animation: mathFall linear infinite, mathGlow 2s ease-in-out infinite;
}

@keyframes mathGlow {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(255, 215, 0, 0.4),
            inset 0 0 5px rgba(255, 255, 255, 0.2);
        opacity: 0.85;
    }
    50% {
        box-shadow: 
            0 0 15px rgba(255, 215, 0, 0.7),
            0 0 25px rgba(255, 215, 0, 0.4),
            inset 0 0 8px rgba(255, 255, 255, 0.3);
        opacity: 1;
    }
}

@keyframes snowfall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Speciální animace pro matematické vzorce - menší rotace */
.snowflake.math-formula {
    animation: mathFall linear infinite, mathGlow 2s ease-in-out infinite;
}

@keyframes mathFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(180deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 10px;
    }
    
    .window {
        font-size: 1.8rem;
    }
    
    .math-problem-container {
        padding: 25px;
    }
    
    #mainBlock {
        padding: 25px 30px;
    }
}

/* Decorative Elements */
.window[data-day] {
    position: relative;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 25px;
    height: 25px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Additional sparkle effect */
.window.today span::before {
    content: '✨';
    position: absolute;
    font-size: 0.5em;
    animation: sparkle 2s ease-in-out infinite;
    top: -10px;
    left: -10px;
}

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