/* FONT */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Birthstone&display=swap');

/* VARIABILI */
:root {
    --bg: #f1f1f1b7;
    --text: #222;
    --accent: #d63f3f;
    --border: #d3d3d3;
    --table-header-bg: #f2f2f2;
    --bg-image: url('images/lightmodebg.png');
    --header-shadow: rgba(0, 0, 0, 0.08);
    --empty-img: url('images/heresemptylight.png');
    --box-border: #000200da;
    --ball-color: #fff;
    --label-color: #111;
    --gift-img: url('images/giftlight.png');
    --gift-shadow-color: rgba(0, 0, 0, 0.45);
    --vibration-fx: url('images/light_vibrationfx.png');
    --paper-crample: url('images/crample.png');
    --paper-mid: url('images/midcrample.png');
    --paper-opened: url('images/opened.png');
    --cat-img: url('images/lookinuplight.png');
    --stairs-img: url('images/stairslight.png');
    --locked-img: url('images/lockedlight.png');
    --overlay-img: url('images/overlay.png');
}

/* DARK MODE */
.dark-theme,
:root.dark-theme {
    --bg: #1a1a1ac0;
    --text: #f2f2f2;
    --accent: #ff5f5f;
    --border: #555;
    --table-header-bg: #2a2a2a;
    --bg-image: url('images/darkmodebg.png');
    --header-shadow: rgb(255 255 255 / 8%);
    --empty-img: url('images/heresemptydark.png');
    --box-border: #d9d8d7ee;
    --ball-color: #111;
    --label-color: #ffffff;
    --gift-img: url('images/giftdark.png');
    --gift-shadow-color: rgba(255, 255, 255, 0.664);
    --vibration-fx: url('images/dark_vibrationfx.png');
    --paper-crample: url('images/crample.png');
    --paper-mid: url('images/midcrample.png');
    --paper-opened: url('images/opened.png');
    --cat-img: url('images/lookinupdark.png');
    --stairs-img: url('images/stairsdark.png');
    --locked-img: url('images/lockeddark.png');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Jost', sans-serif;
    -webkit-tap-highlight-color: transparent;
    /* Transizione fluida per il cambio tema su tutti gli elementi */
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

body {
    background-color: var(--bg);
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text);
    height: 100%;
    min-height: 100vh;
}


#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background-color: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 3px 10px var(--header-shadow);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    width: 100%;
    height: 90px;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

#header.nav-up {
    transform: translateY(-100%);
}

#header h3 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
}

#header h3 i {
    font-size: 40px;
    background: linear-gradient(90deg, rgba(153, 0, 0, 1) 0%, rgba(71, 0, 0, 1) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
    /* Necessario per alcuni browser per applicare il clip correttamente */
}

#header .checkbox {
    position: absolute;
    opacity: 0;
}

.checkbox-label {
    background-color: var(--label-color);
    width: 50px;
    height: 26px;
    border-radius: 50px;
    position: relative;
    padding: 5px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;

}

.fa-moon {
    color: #ffd52d;

}

.fa-sun {
    color: #f39c12;

}

.checkbox-label .ball {
    background-color: var(--ball-color);
    width: 22px;
    height: 22px;
    position: absolute;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    transition: transform 0.2s linear;

}

.checkbox:checked+.checkbox-label .ball {
    transform: translateX(24px);

}

#main-form {
    width: 70%;
    height: 90vh;
    margin: 130px auto 0;
}

.container {
    height: 40%;
    width: 100%;
    margin-top: 40px;
}




.san-valentino {
    width: 100%;
    height: 100%;
    background-color: var(--bg);
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--box-border);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.san-valentino:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.san-valentino:active {
    transform: scale(0.98);
}

.pasqua {
    width: 100%;
    height: 100%;
    border-radius: 25px;
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='25' ry='25' stroke='%23000200' stroke-width='5' stroke-dasharray='15%2c 15' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
    display: flex;
    justify-content: center;
    align-items: center;
}

#empty-image {
    max-width: 80%;
    max-height: 80%;
    content: var(--empty-img);
}

.dark-theme .pasqua {
    background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='25' ry='25' stroke='%23D9D8D7' stroke-width='5' stroke-dasharray='15%2c 15' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e");
}

/* TITOLI */
h1 {
    font-size: 40px;
    margin-bottom: 10px;
}

/* PARAGRAFI */
p {
    margin: 10px 0 20px;
    font-size: 18px;
    color: var(--text);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.back-link {
    text-decoration: none;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.back-link:hover {
    transform: translateX(-5px);
}

.calendar-page-container {
    height: auto !important;
}

.calendar-card-full {
    height: auto !important;
    min-height: 75vh;
    cursor: default !important;
    transform: none !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end !important;
    align-items: center;
    gap: 20px;
}



.calendar-card-full:hover {
    transform: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.home-card {
    background-image: url('images/stvalentine.png');
    background-size: 60% auto;
    background-position: left center;
    background-repeat: no-repeat;
    opacity: 0.9;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 40px 40px 40px;
    /* Ridotto padding superiore per alzare le scritte */
}

.card-info {
    width: 35%;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-info h2 {
    font-size: 1.8rem;
    color: var(--accent);
    line-height: 1.2;
}

.card-info .recipient {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

.card-info .progress {
    font-size: 1rem;
    color: var(--text);
    opacity: 0.7;
    margin-top: 5px;
}

.card-icon {
    display: flex;
    justify-content: center;
    /* Centra l'icona orizzontalmente rispetto al div delle scritte */
    padding-top: 25px;
    font-size: 3.5rem;
    color: var(--accent);
}


/* COUNTDOWN */
.countdown-container {
    width: 100%;
    text-align: center;
    padding: 30px 20px 10px;
    background: transparent;
}

.countdown-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
}

#countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 10px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.countdown-item span {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
}

.countdown-item label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.6;
    margin-top: 5px;
}

/* GRID CALENDARIO */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding: 20px;
    width: 100%;
}

.day-box {
    aspect-ratio: 1 / 1;
    background-color: var(--bg);
    border: 3px solid var(--border);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.day-box i.fa-gift {
    font-size: 4rem;
    color: var(--accent);
    opacity: 0.2;
    transition: all 0.3s ease;
}

.day-box span {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    z-index: 1;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.dark-theme .day-box span {
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

.day-box:hover i.fa-gift {
    transform: scale(1.2) rotate(10deg);
    opacity: 0.4;
}

.day-box:hover span {
    transform: scale(1.1);
    color: var(--accent);
}

.day-span-2 {
    grid-column: span 2;
    aspect-ratio: auto;
    height: 100px;
}

.day-span-4 {
    grid-column: span 4;
    aspect-ratio: auto;
    height: 80px;
}

.day-big {
    grid-column: span 4;
    aspect-ratio: auto;
    height: 140px;
    background-color: var(--accent);
    border: none;
}

.day-big i.fa-gift {
    font-size: 6rem;
    color: #fff;
    opacity: 0.3;
}

.day-big span {
    color: #fff;
    font-size: 2.5rem;
}

.day-big:hover i.fa-gift {
    opacity: 0.5;
}

.day-big:hover span {
    color: #fff;
}

/* Stile per i giorni già aperti */
.day-box.is-opened {
    opacity: 0.65;
    background: linear-gradient(135deg, var(--bg), rgba(0, 128, 0, 0.1));
    border-color: #4CAF50;
    position: relative;
}

.day-box.is-opened::after {
    content: '\f00c';
    /* Font Awesome checkmark */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.2rem;
    color: #4CAF50;
    z-index: 5;
}

.day-box.is-opened i.fa-gift {
    opacity: 0.15;
}

.day-box.is-opened:hover {
    opacity: 0.8;
}

/* Giorno 14 (speciale) con is-opened */
.day-big.is-opened {
    opacity: 0.75;
    background: linear-gradient(135deg, var(--accent), rgba(0, 128, 0, 0.3));
}

.day-big.is-opened::after {
    font-size: 1.8rem;
    top: 15px;
    right: 15px;
    color: #fff;
}

/* Giorno riscattabile (bordo nero in light, bianco in dark) */
.day-box.is-claimable {
    border-color: #000000 !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.dark-theme .day-box.is-claimable {
    border-color: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Pulsante piccolo per saltare al giorno corretto */
.skip-to-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(214, 63, 63, 0.3);
}

.skip-to-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(214, 63, 63, 0.4);
    filter: brightness(1.1);
}

.skip-to-btn:active {
    transform: translateY(0);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

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

.modal-content {
    background-color: var(--bg);
    padding: 40px;
    border-radius: 30px;
    border: 3px solid var(--box-border);
    position: relative;
    max-width: 500px;
    width: 90%;
    min-height: 500px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    /* Assicura che il bagliore non esca dai bordi arrotondati */
}

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

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    padding: 5px;
    line-height: 1;
}

.close-btn:hover {
    color: var(--accent);
    transform: rotate(90deg);
}

#modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

#modal-body p {
    margin: 10px 0 25px;
}

.claim-btn {
    background-color: var(--accent);
    color: #fff;
    border: none;
    padding: 12px 35px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(214, 63, 63, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.claim-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(214, 63, 63, 0.4);
    background-color: #e64a4a;
}

.claim-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.dark-theme .claim-btn {
    box-shadow: 0 4px 15px rgba(255, 95, 95, 0.3);
}

.dark-theme .claim-btn:hover {
    box-shadow: 0 8px 25px rgba(255, 95, 95, 0.4);
}

.modal-gift-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 50px;
    /* Più spazio sotto per il testo */
    overflow: hidden;
    /* Taglia il gatto quando scende */
}

.modal-gift-image {
    width: 320px;
    height: 320px;
    background-image: var(--gift-img);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 2;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.15));
    animation: jumpingGift 3s ease-in-out infinite;
    animation-delay: 1s;
    /* Aspetta 1 secondo prima di iniziare la prima volta */
    transform-origin: center center;
    transition: transform 0.3s ease-out, opacity 0.5s ease;
    /* Fluidità nei cambi di stato */
}

.modal-gift-image.stairs-mode {
    background-image: var(--stairs-img) !important;
}

.modal-gift-image.locked-mode {
    background-image: var(--locked-img) !important;
}

.modal-gift-image.stopping {
    animation-play-state: paused;
}

.vibration-fx {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100px;
    background-image: var(--vibration-fx);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    opacity: 0;
    animation: fxBlink 3s ease-in-out infinite;
    animation-delay: 1s;
}

.vibration-fx.left {
    left: 20px;
    top: 70%;
}

.vibration-fx.right {
    right: 20px;

    transform: translateY(-50%) scaleX(-1);
}

.gift-shadow {
    position: absolute;
    width: 320px;
    height: 320px;
    background-image: var(--cat-img);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    z-index: 1;
    bottom: -45%;
    left: -3%;
    /* Sarà regolato dall'utente */
    transition: transform 0.8s cubic-bezier(0.5, 0, 0.5, 1), opacity 0.5s ease;
    opacity: 0;
    /* Nascondi il gatto all'inizio, apparirà solo sotto la cartaccia */
    pointer-events: none;
}

.gift-shadow.cat-exit {
    /* Usa l'animazione invece della transition semplice per fare il saltino */
    animation: catJumpDown 0.7s cubic-bezier(0.5, 0, 0.5, 1) forwards;
}

@keyframes catJumpDown {
    0% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(200px);
    }
}

.cat-floor {
    position: absolute;
    bottom: -60%;
    left: -50%;
    width: 200%;
    height: 100px;
    background-color: transparent;
    /* Trasparente come richiesto */
    z-index: 2;
    /* Sopra il gatto per nasconderlo */
    pointer-events: none;
}

@keyframes fxBlink {

    0%,
    25%,
    100% {
        opacity: 0;
    }

    5%,
    15% {
        opacity: 0.8;
    }

    10%,
    20% {
        opacity: 0.4;
    }
}

@keyframes jumpingGift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    5% {
        transform: translate(-8px, -4px) rotate(-10deg);
    }

    10% {
        transform: translate(8px, -6px) rotate(10deg);
    }

    15% {
        transform: translate(-8px, -8px) rotate(-10deg);
    }

    20% {
        transform: translate(8px, -10px) rotate(10deg);
    }

    25% {
        transform: translate(0, -15px) rotate(0deg);
    }

    /* Pausa a terra lunga per farlo shakerare meno spesso */
    45%,
    90% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes jumpingShadow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    25% {
        transform: scale(0.8);
        opacity: 0.2;
    }

    60%,
    80% {
        transform: scale(1);
        opacity: 0.3;
    }
}

/* ANIMAZIONI DI APERTURA DEL REGALO */
@keyframes giftShake {
    0% {
        transform: scale(1) translate(0, 0) rotate(0deg);
    }

    10% {
        transform: scale(1.1) translate(-10px, 0) rotate(-8deg);
    }

    20% {
        transform: scale(1.1) translate(10px, 0) rotate(8deg);
    }

    30% {
        transform: scale(1.1) translate(-10px, 0) rotate(-8deg);
    }

    40% {
        transform: scale(1.1) translate(10px, 0) rotate(8deg);
    }

    50% {
        transform: scale(1.1) translate(-10px, 0) rotate(-8deg);
    }

    60% {
        transform: scale(1.1) translate(10px, 0) rotate(8deg);
    }

    70% {
        transform: scale(1.1) translate(-10px, 0) rotate(-8deg);
    }

    80% {
        transform: scale(1.1) translate(10px, 0) rotate(8deg);
    }

    90% {
        transform: scale(1.1) translate(-10px, 0) rotate(-8deg);
    }

    100% {
        transform: scale(1.1) translate(0, 0) rotate(0deg);
    }
}

@keyframes bloom {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(2);
        opacity: 1;
        box-shadow: 0 0 100px 100px #fff;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.modal-gift-image.shaking {
    animation: giftShake 0.6s ease-in-out;
}

.bloom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: normal;
    /* Rimoviamo per un effetto di luce piena */
}

@keyframes bloomIn {
    0% {
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.bloom-overlay.active {
    animation: bloomIn 2.5s ease-in-out forwards;
}

/* Quando il regalo è aperto, mostriamo la carta */
.modal-gift-image.opened {
    background-image: var(--paper-crample) !important;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    transition: background-image 0.3s ease-in-out, transform 0.2s ease, width 0.3s ease, height 0.3s ease;
}

.modal-gift-image.opened:active {
    transform: scale(0.95);
}

.modal-gift-image.paper-mid {
    background-image: var(--paper-mid) !important;
}

.modal-gift-image.paper-opened {
    background-image: var(--paper-opened) !important;
    width: 350px;
    height: 350px;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.gift-content-text {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.gift-content-text.show {
    opacity: 1;
    transform: translateY(0);
}


/* Testo scrollabile dentro il foglio */
.paper-text-scroll {
    width: 75%;
    height: 65%;
    overflow-y: auto;
    font-family: 'Birthstone', cursive;
    font-size: 2rem;
    color: #2c2c2c;
    text-align: left;
    padding-right: 5px;
    font-weight: 400;
    line-height: 1.3;
    /* Assicurati che il testo sia leggibile sopra l'immagine */
}

/* Overlay sopra al foglio e al testo */
.paper-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--overlay-img);
    background-size: 100% 100%;
    /* Adatta l'immagine al contenitore */
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    /* Permette di cliccare e scrollare il testo sottostante */
    z-index: 5;
    /* Deve stare sopra al testo */
}

/* Foto ricordo dentro al foglio */
.paper-photo {
    width: 70%;
    height: 60%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transform: rotate(-2deg);
    z-index: 6;
    pointer-events: none;
}

/* Testo suggerimento sotto al foglio */
.hint-text {
    font-size: 0.9rem;
    color: var(--text);
    opacity: 0.6;
    font-style: italic;
    margin-top: 15px;
    animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.6;
    }
}

/* Scrollbar personalizzata per il foglio */
.paper-text-scroll::-webkit-scrollbar {
    width: 5px;
}

.paper-text-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.paper-text-scroll::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 10px;
}

/* MEDIA QUERIES */
@media (max-width: 768px) {
    #header {
        padding: 0 40px;
        height: 100px;
    }

    #header h3 i {
        font-size: 45px !important;
    }

    .header-text {
        display: none;
    }

    .checkbox-label {
        width: 75px;
        height: 38px;
        padding: 0 10px;
    }

    .checkbox-label .ball {
        width: 32px;
        height: 32px;
        left: 4px;
        top: 3px;
    }

    .checkbox:checked+.checkbox-label .ball {
        transform: translateX(37px);
    }

    .fa-moon,
    .fa-sun {
        font-size: 18px;
    }

    #main-form {
        width: 90%;
        margin-top: 140px;
    }

    .home-card {
        background-image: url('images/stvalentinemobile.png');
        background-size: 130% auto;
        background-position: top center;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        padding: 0 20px 20px 20px;
    }

    .card-info {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
        text-align: left;
        background: transparent;
        backdrop-filter: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .card-text-group {
        text-align: left;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .card-info h2 {
        font-size: 1.2rem;
        margin: 0;
        color: var(--accent);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .card-info .recipient,
    .card-info .progress {
        font-size: 0.85rem;
        margin: 0;
    }

    .card-icon {
        padding-top: 0;
        font-size: 2.8rem;
        display: flex;
        align-items: flex-end;
    }

    /* Feedback al tocco solo per la card della home, non per quella del calendario */
    .san-valentino.home-card:active {
        transform: scale(0.96);
        background-color: rgba(255, 255, 255, 0.05);
        transition: transform 0.1s ease;
    }

    .calendar-card-full:active {
        transform: none !important;
        background-color: var(--bg) !important;
    }

    .dark-theme .san-valentino.home-card:active {
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* COUNTDOWN MOBILE */
    .countdown-container {
        padding: 15px 10px 5px;
    }

    .countdown-title {
        font-size: 0.85rem;
        margin-bottom: 10px !important;
        letter-spacing: 1px;
    }

    #countdown {
        gap: 8px;
    }

    .countdown-item {
        min-width: 60px;
        padding: 8px 5px;
        border-radius: 10px;
    }

    .countdown-item span {
        font-size: 1.2rem;
    }

    .countdown-item label {
        font-size: 0.6rem;
        margin-top: 2px;
    }


    .calendar-grid {
        padding: 15px;
        gap: 10px;
    }

    .day-box {
        border-width: 2px;
    }

    .day-box i.fa-gift {
        font-size: 2.5rem;
    }

    .day-box span {
        font-size: 1.2rem;
    }

    .day-span-2,
    .day-span-4,
    .day-big {
        height: 70px;
    }

    .day-big {
        height: 100px;
    }

    .day-big i.fa-gift {
        font-size: 4rem;
    }

    .day-big span {
        font-size: 1.8rem;
    }

    h1 {
        font-size: 28px;
    }

    p {
        font-size: 16px;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 8px;
    }
}