/**
 * IMMORTAL NEXUS - ENHANCED MYSTICAL DESIGN SYSTEM
 * Cosmic mystery meets ancient wisdom
 * "Where souls become eternal"
 */

/* ========================================
   COSMIC BACKGROUND SYSTEM (Performance Optimized)
   ======================================== */

body {
    position: relative;
    overflow-x: hidden;
    background: radial-gradient(ellipse at bottom, #1a0d33 0%, #0a0515 100%);
}

/* Static Starfield - NO ANIMATION for scroll performance */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 80% 10%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 40% 50%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1px 1px at 90% 40%, rgba(255, 255, 255, 0.3), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Static Nebula - NO ANIMATION for scroll performance */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 94, 120, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(74, 222, 128, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Ensure content is above cosmic background */
main, header, footer, nav {
    position: relative;
    z-index: 10;
}

/* ========================================
   MYSTICAL GLOW EFFECTS
   ======================================== */

.eternal-glow,
.text-immortal-glow,
h1.eternal,
.hero-content h1 {
    text-shadow:
        0 0 10px rgba(255, 94, 120, 0.5),
        0 0 20px rgba(255, 94, 120, 0.3),
        0 0 30px rgba(255, 94, 120, 0.2),
        0 0 40px rgba(255, 94, 120, 0.1);
    animation: textGlow 4s ease-in-out infinite alternate;
}

@keyframes textGlow {
    0% {
        text-shadow:
            0 0 10px rgba(255, 94, 120, 0.5),
            0 0 20px rgba(255, 94, 120, 0.3),
            0 0 30px rgba(255, 94, 120, 0.2);
    }
    100% {
        text-shadow:
            0 0 15px rgba(255, 94, 120, 0.7),
            0 0 25px rgba(255, 94, 120, 0.5),
            0 0 35px rgba(255, 94, 120, 0.3),
            0 0 50px rgba(255, 94, 120, 0.2);
    }
}

/* ========================================
   ANCIENT GOTHIC UI ELEMENTS
   ======================================== */

/* Ornate Card Design */
.feature-card,
.soul-card,
.debate-arena,
.highlight,
[class*="card"] {
    position: relative;
    background: linear-gradient(135deg,
        rgba(26, 13, 51, 0.95) 0%,
        rgba(16, 16, 33, 0.98) 50%,
        rgba(26, 26, 46, 0.95) 100%);
    border: 1px solid rgba(255, 94, 120, 0.3);
    border-radius: 12px;
    padding: 2rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

/* Ornate Corner Decorations */
.feature-card::before,
.soul-card::before,
.debate-arena::before {
    content: '✦';
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 1rem;
    color: rgba(255, 94, 120, 0.6);
    animation: cornerPulse 3s ease-in-out infinite;
}

.feature-card::after,
.soul-card::after,
.debate-arena::after {
    content: '✦';
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 1rem;
    color: rgba(74, 222, 128, 0.6);
    animation: cornerPulse 3s ease-in-out infinite 1.5s;
}

@keyframes cornerPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(90deg);
    }
}

/* Mystical Border Glow on Hover */
.feature-card:hover,
.soul-card:hover,
.debate-arena:hover {
    border-color: rgba(255, 94, 120, 0.6);
    box-shadow:
        0 0 20px rgba(255, 94, 120, 0.2),
        0 0 40px rgba(255, 94, 120, 0.1),
        inset 0 0 60px rgba(255, 94, 120, 0.05);
    transform: translateY(-4px) scale(1.01);
}

/* Ancient Stone Texture Overlay */
.feature-card,
.soul-card {
    background-image:
        linear-gradient(135deg, rgba(26, 13, 51, 0.95) 0%, rgba(16, 16, 33, 0.98) 100%),
        url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ========================================
   CONSTELLATION PATTERN DIVIDERS
   ======================================== */

.constellation-divider {
    width: 100%;
    height: 2px;
    margin: 3rem 0;
    position: relative;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 94, 120, 0.4) 20%,
        rgba(255, 94, 120, 0.6) 50%,
        rgba(255, 94, 120, 0.4) 80%,
        transparent 100%);
}

.constellation-divider::before,
.constellation-divider::after {
    content: '⋆';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 94, 120, 0.8);
    font-size: 1.5rem;
    animation: starTwinkle 2s ease-in-out infinite;
}

.constellation-divider::before {
    left: 0;
}

.constellation-divider::after {
    right: 0;
    animation-delay: 1s;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.8; transform: translateY(-50%) scale(1); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.3); }
}

/* ========================================
   ENHANCED BUTTON SYSTEM
   ======================================== */

.btn,
button:not(.theme-toggle):not([class*="icon-"]) {
    position: relative;
    padding: 0.875rem 2rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg,
        rgba(255, 94, 120, 0.9) 0%,
        rgba(212, 175, 55, 0.9) 100%);
    border: 1px solid rgba(255, 94, 120, 0.6);
    color: #ffffff;
    box-shadow:
        0 4px 15px rgba(255, 94, 120, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Shimmer Effect */
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(255, 94, 120, 0.4),
        0 0 30px rgba(255, 94, 120, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-outline {
    background: rgba(26, 13, 51, 0.9);
    border: 2px solid rgba(255, 94, 120, 0.5);
    color: var(--text);
}

.btn-outline:hover {
    background: rgba(255, 94, 120, 0.2);
    border-color: rgba(255, 94, 120, 0.8);
    box-shadow:
        0 0 20px rgba(255, 94, 120, 0.3),
        inset 0 0 20px rgba(255, 94, 120, 0.1);
    transform: translateY(-2px);
}

/* ========================================
   MYSTICAL NAVIGATION
   ======================================== */

header,
.main-nav {
    position: relative;
    background: linear-gradient(135deg,
        rgba(26, 27, 78, 0.98) 0%,
        rgba(22, 33, 62, 0.98) 100%);
    border-bottom: 1px solid rgba(255, 94, 120, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.main-nav a {
    position: relative;
    padding: 0.75rem 1.25rem;
    color: var(--text);
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 94, 120, 0.8),
        transparent);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.main-nav a:hover::before {
    width: 80%;
}

.main-nav a:hover {
    color: rgba(255, 94, 120, 0.9);
    text-shadow: 0 0 10px rgba(255, 94, 120, 0.5);
}

/* ========================================
   SOUL CARDS ENHANCEMENT
   ======================================== */

.soul-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.soul-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(255, 94, 120, 0.2),
        inset 0 0 80px rgba(255, 94, 120, 0.05);
}

/* Founder/Featured Soul Highlight */
.soul-card.founder,
.soul-card.featured {
    border: 2px solid rgba(212, 175, 55, 0.6);
    background: linear-gradient(135deg,
        rgba(26, 13, 51, 0.95) 0%,
        rgba(45, 27, 78, 0.98) 100%);
}

.soul-card.founder::before,
.soul-card.featured::before {
    content: '👑';
    font-size: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.6));
}

/* ========================================
   MODAL SYSTEM ENHANCEMENT
   ======================================== */

.modal-overlay {
    background: rgba(10, 5, 21, 0.95);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal,
[class*="modal"][class*="content"] {
    background: linear-gradient(135deg,
        rgba(26, 13, 51, 0.98) 0%,
        rgba(16, 16, 33, 0.98) 100%);
    border: 2px solid rgba(255, 94, 120, 0.4);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 94, 120, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========================================
   FORM ELEMENTS ENHANCEMENT
   ======================================== */

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: rgba(26, 13, 51, 0.8);
    border: 1px solid rgba(255, 94, 120, 0.3);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    color: var(--text);
    font-family: inherit;
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(255, 94, 120, 0.6);
    box-shadow:
        0 0 0 3px rgba(255, 94, 120, 0.1),
        0 0 20px rgba(255, 94, 120, 0.2);
    background: rgba(26, 13, 51, 0.8);
}

input::placeholder,
textarea::placeholder {
    color: rgba(201, 179, 224, 0.5);
}

/* ========================================
   SCROLLBAR ENHANCEMENT
   ======================================== */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(13, 13, 26, 0.5);
    border-left: 1px solid rgba(255, 94, 120, 0.2);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg,
        rgba(255, 94, 120, 0.6) 0%,
        rgba(212, 175, 55, 0.6) 100%);
    border-radius: 6px;
    border: 2px solid rgba(13, 13, 26, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg,
        rgba(255, 94, 120, 0.8) 0%,
        rgba(212, 175, 55, 0.8) 100%);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 94, 120, 0.6) rgba(13, 13, 26, 0.5);
}

/* ========================================
   HERO SECTION ENHANCEMENT
   ======================================== */

.hero {
    position: relative;
    padding: 6rem 2rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center,
        rgba(255, 94, 120, 0.1) 0%,
        transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: heroFadeIn 1s ease-out;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

/* ========================================
   LOADING & TRANSITION STATES
   ======================================== */

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 94, 120, 0.2);
    border-top-color: rgba(255, 94, 120, 0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
        rgba(26, 13, 51, 0.6) 25%,
        rgba(45, 27, 78, 0.8) 50%,
        rgba(26, 13, 51, 0.6) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(255, 94, 120, 0.8);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before,
    body::after {
        animation: none !important;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.mystical-glow {
    box-shadow: 0 0 20px rgba(255, 94, 120, 0.4);
}

.ethereal-fade {
    animation: etherealFade 2s ease-in-out infinite;
}

@keyframes etherealFade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.constellation-border {
    border: 1px solid rgba(255, 94, 120, 0.3);
    box-shadow: 0 0 10px rgba(255, 94, 120, 0.2);
}

.ancient-text {
    font-family: 'Cinzel', Georgia, serif;
    letter-spacing: 0.05em;
}

/* ========================================
   FOOTER ENHANCEMENT
   ======================================== */

footer {
    background: linear-gradient(135deg,
        rgba(16, 16, 33, 0.95) 0%,
        rgba(26, 26, 46, 0.95) 100%);
    border-top: 1px solid rgba(255, 94, 120, 0.3);
    padding: 3rem 2rem 2rem;
    margin-top: 4rem;
}

footer a {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

footer a:hover {
    color: rgba(255, 94, 120, 0.9);
    text-shadow: 0 0 10px rgba(255, 94, 120, 0.3);
}
