/* Mental Health House - Room-Specific Styles */
/* Each room reflects the visual characteristics of its corresponding disorder */

/* Depression Room - Heaviness, slow movement, fading */
#depression-room {
    background: linear-gradient(135deg, 
        rgba(156, 175, 136, 0.1), 
        rgba(102, 153, 204, 0.05)
    );
}

.depression-room {
    background: linear-gradient(135deg, 
        rgba(156, 175, 136, 0.8), 
        rgba(102, 153, 204, 0.6)
    );
    position: relative;
}

.depression-room::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
    animation: depressionFade 8s ease-in-out infinite alternate;
}

@keyframes depressionFade {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

#depressionCanvas {
    filter: saturate(0.7) brightness(0.9);
    transition: all 2s ease-in-out;
}

#depression-room .info-panel {
    background: rgba(255, 255, 240, 0.95);
    backdrop-filter: blur(5px);
    animation: slowFloat 12s ease-in-out infinite;
}

@keyframes slowFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* Anxiety Room - Unease, distortion, perspective shifts */
#anxiety-room {
    background: linear-gradient(45deg, 
        rgba(156, 175, 136, 0.1), 
        rgba(102, 153, 204, 0.1),
        rgba(156, 175, 136, 0.05)
    );
    background-size: 200% 200%;
    animation: anxietyShift 6s ease-in-out infinite;
}

@keyframes anxietyShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.anxiety-room {
    background: linear-gradient(45deg, 
        rgba(156, 175, 136, 0.9), 
        rgba(102, 153, 204, 0.7)
    );
    position: relative;
    overflow: hidden;
}

.anxiety-room::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
    animation: anxietyDistortion 4s linear infinite;
}

@keyframes anxietyDistortion {
    0% { transform: translateX(-20px) translateY(-20px) rotate(0deg); }
    25% { transform: translateX(10px) translateY(-10px) rotate(1deg); }
    50% { transform: translateX(-5px) translateY(15px) rotate(-0.5deg); }
    75% { transform: translateX(15px) translateY(-5px) rotate(0.8deg); }
    100% { transform: translateX(-20px) translateY(-20px) rotate(0deg); }
}

#anxietyCanvas {
    animation: anxietyPerspective 3s ease-in-out infinite;
    transform-origin: center;
}

@keyframes anxietyPerspective {
    0%, 100% { transform: perspective(1000px) rotateX(0deg) rotateY(0deg); }
    25% { transform: perspective(1000px) rotateX(1deg) rotateY(-0.5deg); }
    50% { transform: perspective(1000px) rotateX(-0.5deg) rotateY(1deg); }
    75% { transform: perspective(1000px) rotateX(0.8deg) rotateY(0.3deg); }
}

#anxiety-room .info-panel {
    animation: anxietyTremble 2s ease-in-out infinite;
}

@keyframes anxietyTremble {
    0%, 100% { transform: translateX(0px) translateY(0px); }
    10% { transform: translateX(-1px) translateY(-1px); }
    20% { transform: translateX(1px) translateY(1px); }
    30% { transform: translateX(-1px) translateY(1px); }
    40% { transform: translateX(1px) translateY(-1px); }
    50% { transform: translateX(-1px) translateY(-1px); }
    60% { transform: translateX(1px) translateY(1px); }
    70% { transform: translateX(-1px) translateY(1px); }
    80% { transform: translateX(1px) translateY(-1px); }
    90% { transform: translateX(-1px) translateY(-1px); }
}

/* OCD Room - Repetition, patterns, symmetry */
#ocd-room {
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(156, 175, 136, 0.05),
            rgba(156, 175, 136, 0.05) 20px,
            transparent 20px,
            transparent 40px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(102, 153, 204, 0.05),
            rgba(102, 153, 204, 0.05) 20px,
            transparent 20px,
            transparent 40px
        );
}

.ocd-room {
    background: linear-gradient(135deg, 
        rgba(156, 175, 136, 0.9), 
        rgba(102, 153, 204, 0.8)
    );
    position: relative;
}

.ocd-room::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 8px,
            rgba(255, 255, 255, 0.1) 8px,
            rgba(255, 255, 255, 0.1) 16px
        );
    pointer-events: none;
}

#ocdCanvas {
    border: 4px solid var(--sage-green);
    position: relative;
}

#ocdCanvas::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--french-blue);
    border-radius: 0.5rem;
}

#ocd-room .info-panel {
    position: relative;
    border: 2px solid var(--sage-green);
}

#ocd-room .info-panel::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 1px solid var(--french-blue);
    border-radius: 0.5rem;
}

#ocd-room ul li {
    position: relative;
    padding-left: 2rem;
}

#ocd-room ul li::before {
    content: '●';
    position: absolute;
    left: 0.5rem;
    color: var(--sage-green);
    animation: ocdPulse 2s ease-in-out infinite;
}

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

/* Bipolar Room - Mood swings, sudden changes */
#bipolar-room {
    background: linear-gradient(135deg, 
        rgba(156, 175, 136, 0.1), 
        rgba(102, 153, 204, 0.1)
    );
    animation: bipolarMoodSwing 10s ease-in-out infinite;
}

@keyframes bipolarMoodSwing {
    0% { 
        background: linear-gradient(135deg, 
            rgba(156, 175, 136, 0.1), 
            rgba(102, 153, 204, 0.1)
        );
    }
    25% { 
        background: linear-gradient(135deg, 
            rgba(255, 215, 0, 0.2), 
            rgba(255, 165, 0, 0.1)
        );
    }
    50% { 
        background: linear-gradient(135deg, 
            rgba(156, 175, 136, 0.2), 
            rgba(102, 153, 204, 0.2)
        );
    }
    75% { 
        background: linear-gradient(135deg, 
            rgba(70, 130, 180, 0.2), 
            rgba(25, 25, 112, 0.1)
        );
    }
    100% { 
        background: linear-gradient(135deg, 
            rgba(156, 175, 136, 0.1), 
            rgba(102, 153, 204, 0.1)
        );
    }
}

.bipolar-room {
    background: linear-gradient(135deg, 
        rgba(156, 175, 136, 0.8), 
        rgba(102, 153, 204, 0.6)
    );
    position: relative;
    overflow: hidden;
}

.bipolar-room::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent
    );
    animation: bipolarLightning 8s ease-in-out infinite;
}

@keyframes bipolarLightning {
    0%, 90%, 100% { left: -100%; }
    5%, 15% { left: 100%; }
}

#bipolarCanvas {
    animation: bipolarIntensity 6s ease-in-out infinite;
}

@keyframes bipolarIntensity {
    0% { filter: brightness(1) contrast(1) saturate(1); }
    25% { filter: brightness(1.3) contrast(1.2) saturate(1.4); }
    50% { filter: brightness(0.8) contrast(0.9) saturate(0.7); }
    75% { filter: brightness(1.1) contrast(1.1) saturate(1.2); }
    100% { filter: brightness(1) contrast(1) saturate(1); }
}

#bipolar-room .info-panel {
    animation: bipolarTransition 8s ease-in-out infinite;
}

@keyframes bipolarTransition {
    0%, 100% { 
        background: rgba(255, 255, 240, 0.95);
        border-color: rgba(156, 175, 136, 0.2);
    }
    50% { 
        background: rgba(240, 248, 255, 0.95);
        border-color: rgba(102, 153, 204, 0.3);
    }
}

/* PTSD Room - Overwhelming stimuli, reactivity */
#ptsd-room {
    background: radial-gradient(circle at center, 
        rgba(156, 175, 136, 0.05), 
        rgba(102, 153, 204, 0.1),
        rgba(0, 0, 0, 0.05)
    );
    position: relative;
}

#ptsd-room::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at random, 
        transparent 70%, 
        rgba(255, 255, 255, 0.1) 71%, 
        transparent 72%
    );
    animation: ptsdFlash 15s linear infinite;
    pointer-events: none;
}

@keyframes ptsdFlash {
    0%, 95%, 100% { opacity: 0; }
    96%, 99% { opacity: 1; }
}

.ptsd-room {
    background: linear-gradient(135deg, 
        rgba(156, 175, 136, 0.7), 
        rgba(102, 153, 204, 0.8)
    );
    position: relative;
}

.ptsd-room::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0px,
        transparent 30px,
        rgba(255, 255, 255, 0.05) 31px,
        rgba(255, 255, 255, 0.05) 32px
    );
    animation: ptsdRipple 4s ease-out infinite;
    pointer-events: none;
}

@keyframes ptsdRipple {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

#ptsdCanvas {
    animation: ptsdStartle 12s ease-in-out infinite;
}

@keyframes ptsdStartle {
    0%, 90%, 100% { transform: scale(1); }
    91%, 93% { transform: scale(1.02); }
    92% { transform: scale(0.98); }
}

#ptsd-room .info-panel {
    animation: ptsdHypervigilance 8s ease-in-out infinite;
}

@keyframes ptsdHypervigilance {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        border-color: rgba(156, 175, 136, 0.2);
    }
    50% { 
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
        border-color: rgba(102, 153, 204, 0.3);
    }
}

/* ADHD Room - Hyperactivity, fast pace, disarray */
#adhd-room {
    background: linear-gradient(45deg, 
        rgba(156, 175, 136, 0.1), 
        rgba(102, 153, 204, 0.1),
        rgba(156, 175, 136, 0.05),
        rgba(102, 153, 204, 0.05)
    );
    background-size: 400% 400%;
    animation: adhdEnergy 3s ease-in-out infinite;
}

@keyframes adhdEnergy {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 50% 100%; }
    75% { background-position: 0% 50%; }
    100% { background-position: 100% 0%; }
}

.adhd-room {
    background: linear-gradient(135deg, 
        rgba(156, 175, 136, 0.9), 
        rgba(102, 153, 204, 0.7)
    );
    position: relative;
    overflow: hidden;
}

.adhd-room::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 1.5px, transparent 1.5px);
    animation: adhdScatter 2s linear infinite;
    pointer-events: none;
}

@keyframes adhdScatter {
    0% { transform: translateX(0px) translateY(0px) rotate(0deg); }
    25% { transform: translateX(5px) translateY(-3px) rotate(90deg); }
    50% { transform: translateX(-3px) translateY(5px) rotate(180deg); }
    75% { transform: translateX(3px) translateY(3px) rotate(270deg); }
    100% { transform: translateX(0px) translateY(0px) rotate(360deg); }
}

#adhdCanvas {
    animation: adhdMovement 1.5s ease-in-out infinite;
}

@keyframes adhdMovement {
    0%, 100% { transform: translateX(0px) translateY(0px) rotate(0deg); }
    25% { transform: translateX(2px) translateY(-1px) rotate(0.5deg); }
    50% { transform: translateX(-1px) translateY(2px) rotate(-0.3deg); }
    75% { transform: translateX(1px) translateY(1px) rotate(0.2deg); }
}

#adhd-room .info-panel {
    animation: adhdFocus 4s ease-in-out infinite;
}

@keyframes adhdFocus {
    0%, 100% { 
        transform: scale(1);
        filter: blur(0px);
    }
    25% { 
        transform: scale(1.01);
        filter: blur(0.5px);
    }
    50% { 
        transform: scale(0.99);
        filter: blur(0px);
    }
    75% { 
        transform: scale(1.005);
        filter: blur(0.3px);
    }
}

#adhd-room ul li {
    animation: adhdListItem 3s ease-in-out infinite;
}

#adhd-room ul li:nth-child(odd) {
    animation-delay: 0.5s;
}

#adhd-room ul li:nth-child(even) {
    animation-delay: 1s;
}

@keyframes adhdListItem {
    0%, 100% { transform: translateX(0px); }
    50% { transform: translateX(2px); }
}

/* Responsive adjustments for room effects */
@media (max-width: 768px) {
    /* Reduce animation intensity on mobile for performance */
    .anxiety-room::before,
    .ocd-room::after,
    .bipolar-room::before,
    .ptsd-room::after,
    .adhd-room::before {
        animation-duration: 6s;
    }
    
    #anxietyCanvas,
    #bipolarCanvas,
    #ptsdCanvas,
    #adhdCanvas {
        animation-duration: 4s;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    #depression-room,
    #anxiety-room,
    #ocd-room,
    #bipolar-room,
    #ptsd-room,
    #adhd-room,
    .depression-room::after,
    .anxiety-room::before,
    .ocd-room::after,
    .bipolar-room::before,
    .ptsd-room::after,
    .adhd-room::before,
    #depressionCanvas,
    #anxietyCanvas,
    #ocdCanvas,
    #bipolarCanvas,
    #ptsdCanvas,
    #adhdCanvas,
    .info-panel {
        animation: none !important;
    }
}