/* ========================================
   FABULA ARCANA - MAINTENANCE PAGE STYLES
   Pagina manutenzione con effetto ondulatorio
   ======================================== */

/* Reset e base */
.maintenance-page {
    margin: 0;
    padding: 1rem;
    min-height: 100vh;
    font-family: 'Cinzel', 'Times New Roman', serif;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-sizing: border-box;
}

/* ========================================
   BACKGROUND CON EFFETTO ONDULATORIO
   ======================================== */
.maintenance-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
}

.maintenance-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Effetto ondulatorio lento e mistico */
    animation: mysticalWave 12s ease-in-out infinite;
    transform-origin: center center;
    filter: saturate(0.9);
}

@keyframes mysticalWave {
    0%, 100% {
        transform: scale(1.08) translateY(0) rotate(0deg);
        filter: saturate(0.9) brightness(1);
    }
    25% {
        transform: scale(1.12) translateY(-15px) rotate(0.3deg);
        filter: saturate(1) brightness(1.05);
    }
    50% {
        transform: scale(1.08) translateY(8px) rotate(-0.2deg);
        filter: saturate(0.85) brightness(0.98);
    }
    75% {
        transform: scale(1.1) translateY(-8px) rotate(0.15deg);
        filter: saturate(0.95) brightness(1.02);
    }
}

/* Overlay mistico con gradiente */
.maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(
        180deg,
        rgba(13, 13, 26, 0.4) 0%,
        rgba(20, 15, 35, 0.5) 30%,
        rgba(13, 13, 26, 0.6) 70%,
        rgba(10, 10, 20, 0.8) 100%
    );
    animation: overlayPulse 10s ease-in-out infinite alternate;
}

@keyframes overlayPulse {
    0% {
        background: linear-gradient(
            180deg,
            rgba(13, 13, 26, 0.4) 0%,
            rgba(30, 20, 50, 0.5) 30%,
            rgba(13, 13, 26, 0.6) 70%,
            rgba(10, 10, 20, 0.8) 100%
        );
    }
    100% {
        background: linear-gradient(
            180deg,
            rgba(20, 15, 40, 0.45) 0%,
            rgba(13, 13, 26, 0.55) 30%,
            rgba(25, 18, 45, 0.65) 70%,
            rgba(8, 8, 18, 0.85) 100%
        );
    }
}

/* Particelle magiche */
.magic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.magic-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(232, 121, 160, 0.9) 0%, rgba(155, 89, 182, 0.3) 40%, transparent 70%);
    border-radius: 50%;
    animation: floatMagic 20s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(232, 121, 160, 0.5);
}

.magic-particle:nth-child(1) { left: 5%; animation-delay: 0s; animation-duration: 22s; }
.magic-particle:nth-child(2) { left: 15%; animation-delay: 3s; animation-duration: 18s; }
.magic-particle:nth-child(3) { left: 25%; animation-delay: 6s; animation-duration: 25s; }
.magic-particle:nth-child(4) { left: 35%; animation-delay: 2s; animation-duration: 20s; }
.magic-particle:nth-child(5) { left: 45%; animation-delay: 5s; animation-duration: 23s; }
.magic-particle:nth-child(6) { left: 55%; animation-delay: 8s; animation-duration: 19s; }
.magic-particle:nth-child(7) { left: 65%; animation-delay: 1s; animation-duration: 21s; }
.magic-particle:nth-child(8) { left: 75%; animation-delay: 4s; animation-duration: 24s; }
.magic-particle:nth-child(9) { left: 85%; animation-delay: 7s; animation-duration: 17s; }
.magic-particle:nth-child(10) { left: 95%; animation-delay: 9s; animation-duration: 26s; }
.magic-particle:nth-child(11) { left: 10%; animation-delay: 11s; animation-duration: 28s; }
.magic-particle:nth-child(12) { left: 30%; animation-delay: 13s; animation-duration: 16s; }
.magic-particle:nth-child(13) { left: 50%; animation-delay: 10s; animation-duration: 27s; }
.magic-particle:nth-child(14) { left: 70%; animation-delay: 12s; animation-duration: 15s; }
.magic-particle:nth-child(15) { left: 90%; animation-delay: 14s; animation-duration: 29s; }

@keyframes floatMagic {
    0%, 100% {
        transform: translateY(110vh) translateX(0) scale(0);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
        transform: translateY(100vh) translateX(0) scale(1);
    }
    25% {
        transform: translateY(75vh) translateX(20px) scale(1.2);
    }
    50% {
        transform: translateY(50vh) translateX(-15px) scale(0.8);
        opacity: 1;
    }
    75% {
        transform: translateY(25vh) translateX(10px) scale(1.1);
    }
    95% {
        opacity: 0.8;
        transform: translateY(5vh) translateX(-5px) scale(1);
    }
    100% {
        transform: translateY(-5vh) translateX(0) scale(0);
        opacity: 0;
    }
}

/* ========================================
   CONTENUTO PRINCIPALE
   ======================================== */
.maintenance-container {
    text-align: center;
    padding: 3.5rem 3rem;
    max-width: 650px;
    background: rgba(13, 13, 26, 0.88);
    border-radius: 24px;
    border: 1px solid rgba(155, 89, 182, 0.35);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.6),
        0 0 120px rgba(232, 121, 160, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    animation: containerFloat 0.9s ease-out, containerBreath 6s ease-in-out infinite 1s;
    position: relative;
    z-index: 1;
}

@keyframes containerFloat {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes containerBreath {
    0%, 100% {
        box-shadow: 
            0 30px 60px rgba(0, 0, 0, 0.6),
            0 0 100px rgba(232, 121, 160, 0.08);
    }
    50% {
        box-shadow: 
            0 35px 70px rgba(0, 0, 0, 0.65),
            0 0 140px rgba(155, 89, 182, 0.12);
    }
}

/* Logo / Icona */
.maintenance-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    animation: iconGlow 4s ease-in-out infinite;
    display: inline-block;
    filter: drop-shadow(0 0 20px rgba(232, 121, 160, 0.5));
}

@keyframes iconGlow {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 20px rgba(232, 121, 160, 0.5));
    }
    50% {
        transform: scale(1.08) rotate(3deg);
        filter: drop-shadow(0 0 35px rgba(155, 89, 182, 0.7));
    }
}

/* Titolo principale */
.maintenance-title {
    font-size: 2.2rem;
    color: #e879a0;
    margin: 0 0 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 
        0 0 30px rgba(232, 121, 160, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.4);
    animation: titleShimmer 5s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% {
        text-shadow: 
            0 0 20px rgba(232, 121, 160, 0.3),
            0 3px 6px rgba(0, 0, 0, 0.4);
    }
    50% {
        text-shadow: 
            0 0 40px rgba(232, 121, 160, 0.5),
            0 0 60px rgba(155, 89, 182, 0.2),
            0 3px 6px rgba(0, 0, 0, 0.4);
    }
}

/* Sottotitolo */
.maintenance-subtitle {
    font-family: 'Spectral', 'Georgia', serif;
    font-size: 1.15rem;
    color: rgba(240, 230, 211, 0.85);
    margin: 0.5rem 0 2rem;
    font-style: italic;
    line-height: 1.7;
}

/* Messaggio evocativo */
.maintenance-message {
    background: rgba(155, 89, 182, 0.08);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: 16px;
    padding: 1.8rem 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Decorazioni rimosse - causavano problemi di rendering */

.maintenance-message p {
    font-family: 'Spectral', 'Georgia', serif;
    font-size: 1.05rem;
    color: rgba(240, 230, 211, 0.9);
    line-height: 1.8;
    margin: 0;
}

/* Messaggio personalizzato */
.custom-message {
    background: linear-gradient(135deg, rgba(91, 125, 177, 0.12) 0%, rgba(91, 125, 177, 0.05) 100%);
    border-left: 3px solid #5b7db1;
    border-radius: 0 12px 12px 0;
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.custom-message p {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: rgba(240, 230, 211, 0.85);
    margin: 0;
    line-height: 1.6;
}

.custom-message .label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: #5b7db1;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

/* Tempo stimato */
.estimated-return {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(100, 200, 150, 0.1);
    border: 1px solid rgba(100, 200, 150, 0.3);
    border-radius: 30px;
    padding: 0.7rem 1.5rem;
    margin-bottom: 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: rgba(150, 230, 180, 0.9);
}

.estimated-return .icon {
    font-size: 1.1rem;
}

/* Separatore decorativo */
.maintenance-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: rgba(155, 89, 182, 0.4);
}

.maintenance-divider::before,
.maintenance-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(155, 89, 182, 0.3), transparent);
}

/* Sezione Staff */
.staff-section {
    margin-top: 1rem;
    overflow: hidden;
    width: 100%;
}

.staff-section p {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: rgba(240, 230, 211, 0.6);
    margin: 0 0 1rem;
}

.staff-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 2.5rem;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    color: #ffffff;
    background: linear-gradient(135deg, #e879a0 0%, #9b59b6 100%);
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(232, 121, 160, 0.3);
    max-width: 100%;
    box-sizing: border-box;
}

.staff-login-btn:hover {
    background: linear-gradient(135deg, #f08ab0 0%, #a66bbe 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(155, 89, 182, 0.45);
}

.staff-login-btn .icon {
    font-size: 1.2rem;
}

/* Footer */
.maintenance-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(155, 89, 182, 0.15);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: rgba(240, 230, 211, 0.45);
}

.maintenance-footer a {
    color: #e879a0;
    text-decoration: none;
    transition: color 0.2s;
}

.maintenance-footer a:hover {
    color: #f08ab0;
}

/* ========================================
   PAGINA "CI SIAMO SPOSTATI!"
   Timer di reindirizzamento al nuovo sito
   ======================================== */
.maintenance-message p.moved-message {
    font-size: 1.25rem;
    font-style: italic;
    color: rgba(240, 230, 211, 0.95);
}

.moved-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.moved-ring {
    position: relative;
    width: 140px;
    height: 140px;
    filter: drop-shadow(0 0 18px rgba(232, 121, 160, 0.25));
    transition: filter 0.4s ease, opacity 0.4s ease;
}

.moved-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.moved-ring-track {
    fill: rgba(13, 13, 26, 0.5);
    stroke: rgba(155, 89, 182, 0.18);
    stroke-width: 6;
}

.moved-ring-progress {
    fill: none;
    stroke: url(#moved-ring-gradient);
    stroke-width: 6;
    stroke-linecap: round;
}

.moved-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.moved-ring-value {
    font-family: 'Cinzel', serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: #e879a0;
    text-shadow: 0 0 20px rgba(232, 121, 160, 0.45);
    animation: movedPulse 1s ease-in-out infinite;
}

.moved-ring-unit {
    margin-top: 0.35rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(240, 230, 211, 0.55);
}

@keyframes movedPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.moved-countdown-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: rgba(240, 230, 211, 0.75);
    line-height: 1.6;
    margin: 0;
    max-width: 420px;
}

.moved-countdown-text strong {
    color: #e879a0;
    font-weight: 500;
}

.moved-cancel-btn {
    padding: 0.45rem 1.2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: rgba(240, 230, 211, 0.7);
    background: transparent;
    border: 1px solid rgba(155, 89, 182, 0.4);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.moved-cancel-btn:hover {
    color: #ffffff;
    border-color: #e879a0;
    background: rgba(232, 121, 160, 0.1);
}

.moved-cancel-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Timer annullato: anello spento */
.moved-countdown.is-cancelled .moved-ring {
    opacity: 0.45;
    filter: grayscale(0.8);
}

.moved-countdown.is-cancelled .moved-ring-value {
    animation: none;
    color: rgba(240, 230, 211, 0.6);
    text-shadow: none;
}

.staff-section p.moved-notice {
    margin: 1.2rem 0 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    .moved-ring-value {
        animation: none;
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .maintenance-page {
        align-items: stretch;
        padding: 1rem;
    }

    .maintenance-container {
        margin: 1rem auto;
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    .maintenance-title {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }

    .maintenance-subtitle {
        font-size: 1rem;
    }

    .maintenance-icon {
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    .maintenance-container {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
    }

    .maintenance-title {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }

    .maintenance-subtitle {
        font-size: 0.9rem;
    }

    .maintenance-message {
        padding: 1.2rem 1rem;
    }

    .maintenance-message p {
        font-size: 0.95rem;
    }

    .staff-login-btn {
        width: 100%;
        justify-content: center;
        padding: 0.9rem 1.5rem;
    }

    .maintenance-icon {
        font-size: 3rem;
    }

    .estimated-return {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}
