/* Secret realm styles - The domain of Athulan */

/* Hide normal zones in Athulan mode */
body[data-realm="athulan"] .zone-1,
body[data-realm="athulan"] .zone-2,
body[data-realm="athulan"] .zone-3,
body[data-realm="athulan"] .zone-4,
body[data-realm="athulan"] .zone-5 {
    display: none !important;
}

/* The Gateway of Athulan */
.zone-athulan {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vh;
    max-width: 600px;
    max-height: 600px;
    border: 3px solid rgba(138, 43, 226, 0.01);
    border-radius: 50% 20% 50% 20%;
    background: transparent;
    transition: all 3s ease;
    z-index: 100;
}

/* Show Athulan zone only in Athulan mode */
body[data-realm="athulan"] .zone-athulan {
    display: block;
    animation: athulanAwakening 3s ease-out forwards;
}

/* Les règles de position redondantes pour .zone-athulan.permanently-activated ont été supprimées */

/* Ethereal veil effect */
.ethereal-veil {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    pointer-events: none;
    z-index: -3;
    opacity: 0;
    transition: opacity 3s ease;
}

body[data-realm="athulan"] .ethereal-veil {
    opacity: 1;
    background:
            radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.05) 0%, transparent 70%),
            radial-gradient(circle at 20% 30%, rgba(75, 0, 130, 0.03) 0%, transparent 40%),
            radial-gradient(circle at 80% 70%, rgba(147, 112, 219, 0.04) 0%, transparent 45%);
    animation: etherealPulse 12s ease-in-out infinite;
}

/* Athulan filter overlay */
.athulan-filter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 989;
    opacity: 0;
    transition: opacity 2s ease;
}

body[data-realm="athulan"] .athulan-filter {
    opacity: 1;
    background:
            linear-gradient(45deg, transparent 48%, rgba(138, 43, 226, 0.01) 50%, transparent 52%),
            linear-gradient(-45deg, transparent 48%, rgba(75, 0, 130, 0.01) 50%, transparent 52%);
    background-size: 30px 30px;
    animation: athulanGrid 20s linear infinite;
}

/* Special question mark for Athulan */
.zone-athulan::before {
    content: '⧈';  /* Mystical symbol */
    font-size: 10rem;
    color: rgba(138, 43, 226, 0.02);
    animation: athulanSymbol 6s ease-in-out infinite;
}

/* Athulan zone states */
.zone-athulan.activating {
    border-color: rgba(138, 43, 226, 0.3);
    box-shadow:
            0 0 60px rgba(138, 43, 226, 0.2),
            inset 0 0 40px rgba(147, 112, 219, 0.1);
}

.zone-athulan.activating::before {
    color: rgba(147, 112, 219, 0.5);
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
}

/* Athulan permanently activated state */
.zone-athulan.permanently-activated {
    background-image: url('../assets/img/athulan.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border: 3px solid rgba(147, 112, 219, 0.3);
    box-shadow:
            0 0 80px rgba(138, 43, 226, 0.3),
            inset 0 0 60px rgba(75, 0, 130, 0.2);
    animation: athulanGlow 4s ease-in-out infinite;
    overflow: hidden;
}

.zone-athulan.permanently-activated::before {
    display: none;
}

/* Book icon for Athulan */
.zone-athulan.permanently-activated::after {
    content: '📜';  /* Ancient scroll instead of book */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow:
            0 0 10px rgba(0, 0, 0, 0.9),
            0 0 15px rgba(0, 0, 0, 0.7),
            0 0 20px rgba(138, 43, 226, 0.4),
            0 0 30px rgba(138, 43, 226, 0.3);
    z-index: 9999;
    pointer-events: none;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.8));
    animation: ancientScroll 4s ease-in-out infinite;
}

/* Hover effect for Athulan zone */
.zone-athulan.permanently-activated:hover {
    opacity: 1 !important;
    filter: none;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
    border: 4px solid rgba(147, 112, 219, 0.9);
    box-shadow:
            0 0 40px rgba(138, 43, 226, 0.5),
            inset 0 0 30px rgba(147, 112, 219, 0.2),
            0 0 60px rgba(138, 43, 226, 0.4);
}

.zone-athulan.permanently-activated:hover::after {
    font-size: 6rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow:
            0 0 12px rgba(0, 0, 0, 1),
            0 0 18px rgba(0, 0, 0, 0.8),
            0 0 25px rgba(138, 43, 226, 0.6),
            0 0 35px rgba(138, 43, 226, 0.5);
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.9));
}

/* Fairy modifications in Athulan mode */
body[data-realm="athulan"] .blue-entity {
    filter: drop-shadow(0 0 20px rgba(138, 43, 226, 0.5)) hue-rotate(45deg);
}

body[data-realm="athulan"] .orbital-particle {
    background: radial-gradient(circle, rgba(147, 112, 219, 0.9) 0%, transparent 70%);
}

/* Background modifications */
body[data-realm="athulan"] .background-container {
    filter: hue-rotate(15deg) brightness(0.9) contrast(1.1);
}

/* Special animations for Athulan */
@keyframes athulanAwakening {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(180deg);
        filter: blur(20px);
    }
    50% {
        opacity: 0.5;
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        filter: blur(0);
    }
}

@keyframes etherealPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes athulanGrid {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(30px) translateY(30px); }
}

@keyframes athulanSymbol {
    0%, 100% {
        transform: rotate(-5deg) scale(1);
        opacity: 0.02;
    }
    33% {
        transform: rotate(5deg) scale(1.05);
        opacity: 0.04;
    }
    66% {
        transform: rotate(-3deg) scale(0.95);
        opacity: 0.03;
    }
}

@keyframes athulanGlow {
    0%, 100% {
        filter: brightness(1) saturate(1.2);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        filter: brightness(1.1) saturate(1.5);
        transform: translate(-50%, -50%) scale(1.01);
    }
}

@keyframes ancientScroll {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(-5deg);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) rotate(5deg) scale(1.1);
        opacity: 0.9;
    }
}

/* Console Easter Egg Style */
.console-athulan-message {
    color: #8B2BE2;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(138, 43, 226, 0.5);
}

/* Story overlay modifications for Athulan */
.story-overlay.athulan-story .story-text-container {
    border-color: rgba(138, 43, 226, 0.3);
    background: rgba(20, 10, 30, 0.9);
}

.story-overlay.athulan-story .story-title {
    color: rgba(200, 150, 255, 0.95);
    text-shadow:
            2px 2px 4px rgba(75, 0, 130, 0.5),
            -1px -1px 2px rgba(147, 112, 219, 0.3);
}

.story-overlay.athulan-story .story-particle {
    background: rgba(138, 43, 226, 0.2);
}

/* Additional fix for fade-in animation */
.zone-athulan.permanently-activated.fade-in {
    animation: athulanImageAppear 4s ease-in-out forwards !important;
}

@keyframes athulanImageAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    25% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}