/* Existential Crisis & Deep Questions Styles */

@keyframes existentialPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.8), 0 0 45px rgba(236, 72, 153, 0.6);
    }
}

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

@keyframes voidGaze {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px);
    }
    33% {
        opacity: 0.3;
        transform: scale(0.8);
        filter: blur(1px);
    }
    66% {
        opacity: 0.6;
        transform: scale(1.2);
        filter: blur(2px);
    }
}

@keyframes purposeSeek {
    0% {
        transform: translateX(-100%) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
        transform: translateX(0) rotate(180deg);
    }
    100% {
        transform: translateX(100%) rotate(360deg);
        opacity: 0;
    }
}

@keyframes existentialRipple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

@keyframes crisisGlow {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(236, 72, 153, 0.3),
            inset 0 0 10px rgba(236, 72, 153, 0.1);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(236, 72, 153, 0.8),
            0 0 50px rgba(139, 92, 246, 0.6),
            inset 0 0 20px rgba(236, 72, 153, 0.3);
    }
}

@keyframes philosophicalDrift {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 1;
    }
    33% {
        transform: translateY(-15px) rotate(2deg);
        opacity: 0.8;
    }
    66% {
        transform: translateY(10px) rotate(-1deg);
        opacity: 0.9;
    }
}

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

/* Enhanced existential class styles */
.existential-pulse {
    animation: existentialPulse 3s ease-in-out infinite;
}

.questioning-shake {
    animation: questioningShake 4s ease-in-out infinite;
}

.void-gaze {
    animation: voidGaze 6s ease-in-out infinite;
}

.purpose-seek {
    animation: purposeSeek 5s linear infinite;
}

.crisis-glow {
    animation: crisisGlow 4s ease-in-out infinite;
}

.philosophical-drift {
    animation: philosophicalDrift 8s ease-in-out infinite;
}

.existential-breathing {
    animation: existentialBreathing 5s ease-in-out infinite;
}

/* Existential overlay effects */
.existential-overlay {
    position: relative;
    overflow: hidden;
}

.existential-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(139, 92, 246, 0.1),
        rgba(236, 72, 153, 0.1),
        transparent
    );
    animation: existential-sweep 6s infinite;
    z-index: 1;
}

@keyframes existential-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Crisis mode indicators */
.crisis-mode {
    background: linear-gradient(
        45deg,
        rgba(236, 72, 153, 0.1),
        rgba(139, 92, 246, 0.1),
        rgba(245, 158, 11, 0.1)
    );
    background-size: 300% 300%;
    animation: crisis-gradient 4s ease infinite;
    border: 2px solid rgba(236, 72, 153, 0.3);
    position: relative;
}

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

.crisis-mode::after {
    content: '🤔';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
    opacity: 0.5;
    animation: existentialPulse 2s infinite;
}

/* Purpose justification meters */
.purpose-meter {
    background: linear-gradient(
        90deg,
        #ef4444,
        #f59e0b,
        #10b981
    );
    background-size: 300% 100%;
    transition: background-position 1s ease;
    position: relative;
    overflow: hidden;
}

.purpose-meter.low {
    background-position: 0% 0;
}

.purpose-meter.medium {
    background-position: 50% 0;
}

.purpose-meter.high {
    background-position: 100% 0;
}

.purpose-meter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    animation: purpose-shimmer 2s infinite;
}

@keyframes purpose-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Philosophical contemplation styles */
.contemplation-zone {
    background: radial-gradient(
        circle at center,
        rgba(139, 92, 246, 0.05),
        rgba(236, 72, 153, 0.05),
        rgba(20, 184, 166, 0.05)
    );
    border: 1px solid rgba(139, 92, 246, 0.2);
    position: relative;
}

.contemplation-zone::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    margin: -50px 0 0 -50px;
    border: 2px solid rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    animation: existentialRipple 4s infinite;
    pointer-events: none;
}

/* Enhanced loading states for existential processing */
.existential-loader {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    border-top: 5px solid #8b5cf6;
    border-right: 5px solid #ec4899;
    border-bottom: 5px solid #14b8a6;
    animation: existential-spin 2s linear infinite;
}

@keyframes existential-spin {
    0% {
        transform: rotate(0deg);
        filter: hue-rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
        filter: hue-rotate(360deg);
    }
}

/* Void staring effects */
.void-stare {
    background: radial-gradient(
        circle,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(107, 114, 128, 0.05) 50%,
        transparent 100%
    );
    position: relative;
}

.void-stare::after {
    content: '👁️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    opacity: 0.1;
    animation: voidGaze 8s infinite;
}

/* Geysergod wisdom highlighting */
.geysergod-wisdom {
    background: linear-gradient(
        135deg,
        rgba(245, 158, 11, 0.1),
        rgba(139, 92, 246, 0.1)
    );
    border-left: 5px solid #f59e0b;
    position: relative;
    padding: 1rem;
}

.geysergod-wisdom::before {
    content: '🙏';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.6;
    animation: existentialBreathing 3s infinite;
}

/* Responsive existential design */
@media (max-width: 768px) {
    .existential-pulse {
        animation-duration: 2s;
    }
    
    .questioning-shake {
        animation-duration: 3s;
    }
    
    .existential-loader {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
    
    .contemplation-zone::before {
        width: 60px;
        height: 60px;
        margin: -30px 0 0 -30px;
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    .existential-pulse,
    .crisis-glow {
        animation: none;
        border: 3px solid #8b5cf6 !important;
        background: rgba(139, 92, 246, 0.1) !important;
    }
    
    .geysergod-wisdom {
        background: #f59e0b;
        color: #000;
        border-left-width: 8px;
    }
    
    .void-stare::after {
        opacity: 0.8;
        color: #000;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .existential-pulse,
    .questioning-shake,
    .void-gaze,
    .purpose-seek,
    .crisis-glow,
    .philosophical-drift,
    .existential-breathing {
        animation: none;
    }
    
    .existential-overlay::before {
        animation: none;
        opacity: 0.1;
    }
    
    .crisis-mode {
        animation: none;
        background: rgba(236, 72, 153, 0.1);
    }
    
    .existential-loader {
        animation: none;
        border-top-color: #8b5cf6;
        border-right-color: #ec4899;
    }
}

/* Print styles for philosophical documentation */
@media print {
    .existential-pulse,
    .crisis-glow,
    .philosophical-drift {
        animation: none;
        background: rgba(139, 92, 246, 0.1) !important;
        border: 1px solid #8b5cf6 !important;
    }
    
    .geysergod-wisdom {
        background: #f5f5f5 !important;
        border-left: 5px solid #000 !important;
    }
    
    .void-stare::after,
    .crisis-mode::after {
        display: none;
    }
}

/* Custom scrollbar with existential theme */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(
        45deg,
        rgba(139, 92, 246, 0.1),
        rgba(236, 72, 153, 0.1)
    );
    border-radius: 7px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        45deg,
        #8b5cf6,
        #ec4899,
        #14b8a6
    );
    border-radius: 7px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        45deg,
        #7c3aed,
        #db2777,
        #0d9488
    );
    background-clip: content-box;
}

/* Selection with existential colors */
::selection {
    background: linear-gradient(45deg, #8b5cf6, #ec4899);
    color: white;
}

::-moz-selection {
    background: #8b5cf6;
    color: white;
}

/* Focus states for existential interactions */
.existential-focus:focus {
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(139, 92, 246, 0.3),
        0 0 0 8px rgba(236, 72, 153, 0.2),
        0 0 20px rgba(139, 92, 246, 0.4);
    border-color: #8b5cf6;
    transition: box-shadow 0.3s ease;
}

/* Interactive existential elements */
.interactive-existential {
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.interactive-existential:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(139, 92, 246, 0.3),
        0 0 20px rgba(236, 72, 153, 0.2);
}

.interactive-existential:active {
    transform: translateY(-1px);
    box-shadow: 
        0 5px 20px rgba(139, 92, 246, 0.4),
        0 0 15px rgba(236, 72, 153, 0.3);
}

.interactive-existential:hover::after {
    content: '🤔';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 16px;
    animation: existentialPulse 1s infinite;
}