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

body {
    font-family: 'Arial', sans-serif;
    background: url('background.png') center/cover no-repeat fixed;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0;
    padding: 0;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    z-index: 0;
    pointer-events: none;
}

.container {
    width: 100%;
    height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

h1 {
    display: none;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.calendar-box {
    position: relative;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.2s;
    aspect-ratio: 1;
}

.calendar-box::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 3px dashed rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    z-index: 0;
    pointer-events: none;
    box-shadow: none;
}

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

.calendar-box:hover::before {
    border-color: rgba(0, 0, 0, 1);
    box-shadow: none;
}

.box-front,
.box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    top: 0;
    left: 0;
}

.box-front {
    background-image: url('background.png');
    background-size: 100vw 100vh;
    background-repeat: no-repeat;
    border: none;
    transform-origin: left center;
    transition: transform 0.8s ease-in-out;
    z-index: 2;
    position: absolute;
}

.box-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    pointer-events: none;
}

.day-number {
    font-size: 3.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9),
                 -1px -1px 2px rgba(0, 0, 0, 0.9),
                 1px 1px 6px rgba(0, 0, 0, 1);
    position: relative;
    z-index: 1;
}

.box-back {
    background: #000;
    border: none;
    z-index: 1;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
}

.box-back p {
    font-size: 3em;
    margin: 0;
    color: #fff;
}

/* Style pour les photos dans les cases */
.box-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s;
}

.box-photo:hover {
    transform: scale(1.05);
}

/* Modal pour afficher les photos en grand */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

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

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: scale(0.7); }
    to { transform: scale(1); }
}

.modal-image {
    width: 100%;
    height: 100%;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10001;
}

.modal-close:hover {
    color: #ff6b6b;
}

/* Style pour les citations dans les cases */
.quote-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    height: 100%;
    cursor: pointer;
    transition: transform 0.3s;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 107, 107, 0.2) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    position: relative;
}

.quote-container::before {
    content: '✨';
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 1.2em;
    opacity: 0.6;
}

.quote-container::after {
    content: '✨';
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 1.2em;
    opacity: 0.6;
}

.quote-container:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 107, 107, 0.3) 100%);
}

.quote-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.quote-text {
    font-size: 0.7em;
    text-align: center;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Modal pour les citations */
.quote-modal-content {
    max-width: 600px;
    padding: 50px 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.quote-modal-body {
    text-align: center;
}

.quote-modal-icon {
    font-size: 4em;
    margin-bottom: 30px;
    animation: pulse 2s infinite;
}

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

.quote-modal-text {
    font-size: 1.8em;
    color: #fff;
    line-height: 1.6;
    font-style: italic;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-family: Georgia, serif;
}

/* Animation de confettis */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    z-index: 10002;
    animation: confetti-fall linear forwards;
    opacity: 1;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotateZ(720deg);
        opacity: 0;
    }
}

/* Animation d'ouverture - la porte s'ouvre vers la gauche */
.calendar-box.opened .box-front {
    transform: perspective(1200px) rotateY(-160deg);
}

/* Style pour le contenu révélé */
.calendar-box.opened .box-back {
    background: #000;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
    opacity: 1;
    pointer-events: auto;
}

/* Masquer le contour pointillé quand la case est ouverte */
.calendar-box.opened::before {
    opacity: 0;
}

/* Style pour les cases verrouillées */
.calendar-box.locked {
    filter: grayscale(0.3);
}

.calendar-box.locked:hover {
    transform: scale(1);
}

/* Animation de secousse pour les cases verrouillées */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Responsive pour petits écrans */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }
    
    .calendar-grid {
        gap: 6px;
    }
    
    .day-number {
        font-size: 2.5em;
    }
    
    .box-back p {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(16, 1fr);
        gap: 5px;
    }
    
    .day-number {
        font-size: 1.8em;
    }
    
    .box-back p {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }
    
    .calendar-grid {
        gap: 4px;
    }
    
    .day-number {
        font-size: 1.2em;
    }
    
    .box-back p {
        font-size: 1.2em;
    }
    
    .box-front,
    .box-back {
        border-radius: 8px;
        border-width: 2px;
    }
}
