/* -------------------- RESET E BASE -------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(180deg, #F3F4F6, #E5E7EB);
    color: #111827;
    scroll-behavior: smooth;
}

a {
    text-decoration: none;
    color: inherit;
}

section {
    padding: 60px 15px;
    max-width: 1000px;
    margin: 0 auto;
}

h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: 1s ease;
}

section.show h2 {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------- HERO -------------------- */
header {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #1E3A8A, #3B82F6);
    color: white;
    position: relative;
    overflow: hidden;
    padding: 0 20px;
}

header img {
    width: 100px;
    margin-bottom: 20px;
    border-radius: 20px;
}

header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: 1s ease;
}

header p {
    font-size: 1rem;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    transition: 1s ease 0.3s;
}

header.show h1,
header.show p {
    opacity: 1;
    transform: translateY(0);
}

.scroll-down {
    margin-top: 30px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    animation: bounce 1.5s infinite;
    text-align: center;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(10px);
    }

    60% {
        transform: translateY(5px);
    }
}

@media(min-width: 768px) {
    .scroll-down {
        font-size: 2.5rem;
    }
}

/* -------------------- GRID E CARD -------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    opacity: 0;
    transform: translateY(20px);
}

.card.show {
    opacity: 1;
    transform: translateY(0);
}

.card h3 {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 15px;
}

.card p {
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.card button {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.primary-btn,
.secondary-btn {
    background: linear-gradient(135deg, #1E3A8A, #3B82F6);
}

/* -------------------- ABOUT ME -------------------- */
.about {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
    justify-content: center;
    text-align: center;
}

.about img {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    object-fit: cover;
}

.about div {
    max-width: 500px;
    text-align: left;
    line-height: 1.6;
}

/* -------------------- SKILLS -------------------- */
.skills-box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.skill {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 80px;
}

.skill i,
.skill img.adobe {
    width: 60px;
    height: 60px;
    font-size: 3rem;
    object-fit: contain;
    margin-bottom: 5px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.skill img.adobe:hover,
.skill i:hover {
    transform: scale(1.2);
}

/* -------------------- CONTACT -------------------- */
.contact {
    text-align: center;
}

.contact a {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 25px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1E3A8A, #3B82F6);
    color: white;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}

.contact a:hover {
    background: linear-gradient(135deg, #3B82F6, #1E3A8A);
    transform: scale(1.05);
}

.contact-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: center;
    align-items: flex-start;
}

.contact-info,
.form-card,
.user-info {
    width: 100%;
    margin: 0 auto;
    min-width: unset;
    max-width: unset;
}

.contact-info-flex {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.contact-info-left {
    flex: 2;
    text-align: left;
    padding-right: 32px;
}

.contact-info-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
    justify-content: center;
}

.contact-wrapper.logged .contact-info {
    display: none !important;
}

.contact-wrapper.logged .user-info {
    display: block !important;
}

.contact-wrapper.logged .form-card {
    display: block !important;
}

/* -------------------- USER E FORM -------------------- */
.user-info {
    background: #f3f4f6;
    border: 1px solid #2563eb22;
    box-shadow: 0 2px 12px #2563eb11;
    padding: 32px 24px;
    border-radius: 18px;
    text-align: center;
    min-width: 280px;
    max-width: 340px;
    margin: 0 auto;
    display: none;
}

.form-card {
    min-width: 320px;
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px #2563eb22;
    padding: 32px 24px;
    text-align: left;
    display: none;
}

.big-input,
.message-card textarea {
    font-size: 1.15rem;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1.5px solid #2563eb33;
    margin-bottom: 8px;
    background: #f3f4f6;
    width: 100%;
    box-sizing: border-box;
}

/* -------------------- PULSANTI PICCOLI MA LUNGHI -------------------- */
#emailBtnInfo,
#loginBtnInfo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #1E3A8A, #3B82F6);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    /* piccolo in altezza */
    min-width: 220px;
    /* lungo come login Discord */
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
    box-sizing: border-box;
}

#emailBtnInfo:hover,
#loginBtnInfo:hover {
    background: linear-gradient(135deg, #3B82F6, #1E3A8A);
    transform: scale(1.05);
}

/* -------------------- POPUP COUNTDOWN PULITO -------------------- */
#birthdayPopup {
    display: none;
    position: absolute;
    background-color: #3B82F6; /* blu uniforme */
    color: #ffffff;             /* testo timer bianco */
    border-radius: 16px;
    padding: 20px 24px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    text-align: center;
    min-width: 220px;
    max-width: 280px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Mostra popup */
#birthdayPopup.show {
    opacity: 1;
    transform: translateY(0);
}

/* Titolo "Countdown compleanno" */
/* Titolo inline e più grande */
#birthdayPopup strong {
    display: inline-block;      /* permette di stare su una riga */
    font-family: 'Montserrat', sans-serif;
    font-size: 1.rem;          /* più grande */
    font-weight: 500;
    color: #ffffff;
    margin-bottom: 15px;        /* spazio dal timer */
    white-space: nowrap;         /* impedisce l’andare a capo */
}


/* Timer */
#birthdayPopup #countdownTimer {
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    color: #ffffff; /* bianco */
    word-break: break-word;
    margin-top: 5px;
    
}

/* Hover leggero */
#birthdayPopup:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

/* Mobile */
@media(max-width: 768px) {
    #birthdayPopup {
        min-width: 180px;
        max-width: 240px;
        font-size: 0.95rem;
        padding: 16px 18px;
    }

    #birthdayPopup strong {
        font-size: 1rem;
    }

    #birthdayPopup #countdownTimer {
        font-size: 0.95rem;
    }
}



/* -------------------- ALERTS -------------------- */
.alert {
    display: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
}

.alert.show {
    display: block;
}

.alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #34d399;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* -------------------- MOBILE SPECIFICO -------------------- */
@media(max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 0.95rem;
        max-width: 90%;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .about {
        flex-direction: column;
        gap: 20px;
    }

    .about img {
        width: 120px;
        height: 120px;
    }

    .contact-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .contact-info-flex {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .contact-info-left,
    .contact-info-right {
        padding: 0;
        text-align: center;
    }

    /* Mantenere le icone grandi anche su mobile */
    .skill {
        max-width: 80px;
    }

    .skill i,
    .skill img.adobe {
        width: 60px;
        height: 60px;
        font-size: 3rem;
    }
}
