/* Reset a základní styly */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #fff0f5 50%, #ffe4e1 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Sněhové vločky */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.snowflake {
    position: absolute;
    color: #fff;
    font-size: 1em;
    animation: fall linear infinite;
    opacity: 0.8;
}

.snowflake:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.snowflake:nth-child(2) { left: 20%; animation-duration: 10s; animation-delay: 1s; }
.snowflake:nth-child(3) { left: 30%; animation-duration: 7s; animation-delay: 2s; }
.snowflake:nth-child(4) { left: 40%; animation-duration: 9s; animation-delay: 3s; }
.snowflake:nth-child(5) { left: 50%; animation-duration: 6s; animation-delay: 4s; }
.snowflake:nth-child(6) { left: 60%; animation-duration: 8s; animation-delay: 5s; }
.snowflake:nth-child(7) { left: 70%; animation-duration: 11s; animation-delay: 6s; }
.snowflake:nth-child(8) { left: 80%; animation-duration: 7s; animation-delay: 7s; }
.snowflake:nth-child(9) { left: 90%; animation-duration: 9s; animation-delay: 8s; }
.snowflake:nth-child(10) { left: 95%; animation-duration: 8s; animation-delay: 9s; }

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

/* Hudební ovládání */
.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.music-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.music-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.music-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
}

/* Hlavní kontejner */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.header h1 {
    font-size: 3rem;
    color: #d63384;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    color: #8b5a96;
    font-weight: 300;
    font-style: italic;
}

/* Kalendář */
.calendar {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

/* Políčka kalendáře */
.calendar-day {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.calendar-day::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.calendar-day:hover::before {
    transform: translateX(100%);
}

.calendar-day:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.calendar-day:active {
    transform: scale(0.95);
}

/* Zamčená políčka */
.calendar-day.locked {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    cursor: not-allowed;
    opacity: 0.6;
    position: relative;
}

.calendar-day.locked::after {
    content: '🔒';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.calendar-day.locked:hover {
    transform: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.calendar-day.locked::before {
    display: none;
}

.calendar-day.locked .day-content {
    opacity: 0.5;
}

/* Speciální 24. den */
.calendar-day.special-day {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa8a8 100%);
    border: 3px solid #ff4757;
}

.calendar-day.special-day:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff8a80 100%);
}

.day-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.day-content {
    font-size: 1.8rem;
    opacity: 0.9;
}

/* Pop-up okno */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.popup.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-content {
    background: linear-gradient(135deg, #fff 0%, #fef7f7 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #d63384;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    transform: scale(1.2);
    color: #ff1744;
}

.letter-content {
    text-align: center;
}

.letter-header h3 {
    color: #d63384;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.letter-body {
    margin-bottom: 30px;
}

.letter-body p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    font-style: italic;
    text-align: left;
    background: rgba(255, 182, 193, 0.1);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ff6b9d;
}

.letter-signature {
    color: #d63384;
    font-weight: 500;
    font-style: italic;
}

/* Animace */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsivní design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .subtitle {
        font-size: 1rem;
        padding: 0 20px;
    }
    
    .calendar {
        padding: 20px 15px;
        margin: 0 10px;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    .calendar-day {
        min-height: 75px;
        border-radius: 12px;
    }
    
    .day-number {
        font-size: 1.1rem;
        margin-bottom: 3px;
    }
    
    .day-content {
        font-size: 1.3rem;
    }
    
    .popup-content {
        padding: 25px 20px;
        margin: 15px;
        max-width: 95%;
    }
    
    .letter-header h3 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .letter-body p {
        font-size: 1rem;
        line-height: 1.6;
        padding: 15px;
    }
    
    .music-control {
        top: 15px;
        right: 15px;
    }
    
    .music-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .header {
        padding: 20px 0;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 0.9rem;
        padding: 0 15px;
        line-height: 1.4;
    }
    
    .calendar {
        padding: 15px 10px;
        margin: 0 5px;
        border-radius: 15px;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .calendar-day {
        min-height: 65px;
        border-radius: 10px;
    }
    
    .day-number {
        font-size: 1rem;
        margin-bottom: 2px;
    }
    
    .day-content {
        font-size: 1.1rem;
    }
    
    .popup-content {
        padding: 20px 15px;
        margin: 10px;
        max-width: 98%;
        border-radius: 15px;
    }
    
    .letter-header h3 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .letter-body p {
        font-size: 0.95rem;
        line-height: 1.5;
        padding: 12px;
    }
    
    .close-btn {
        top: 10px;
        right: 15px;
        font-size: 1.5rem;
    }
    
    .music-control {
        top: 10px;
        right: 10px;
    }
    
    .music-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Extra malé obrazovky */
@media (max-width: 360px) {
    .header h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .calendar-day {
        min-height: 60px;
    }
    
    .day-number {
        font-size: 0.9rem;
    }
    
    .day-content {
        font-size: 1rem;
    }
}

/* Touch zařízení */
.touch-device .calendar-day {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.touch-device .calendar-day:active {
    transform: scale(0.95);
}

/* Mobilní optimalizace pro pop-up */
@media (max-width: 768px) {
    .popup {
        padding: 10px;
    }
    
    .popup-content {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Vylepšení pro malé obrazovky */
@media (max-width: 360px) {
    .calendar-day.locked::after {
        font-size: 0.7rem;
        top: 3px;
        right: 3px;
    }
    
    .music-btn[title]:hover::after {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}
