/* Glow Text Effects */
.glow-text-green {
    text-shadow: 0 0 6px rgba(34, 197, 94, 0.6), 0 0 12px rgba(34, 197, 94, 0.4);
}

.glow-text-blue {
    text-shadow: 0 0 6px rgba(59, 130, 246, 0.6), 0 0 12px rgba(59, 130, 246, 0.4);
}

/* Fade In Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fadeIn { animation: fadeIn 0.8s ease-out forwards; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease-out forwards; }
.animate-fadeInScale { animation: fadeInScale 0.7s ease-out forwards; }

/* Glass Card Hover */
.glass-card img {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-card img:hover {
    filter: brightness(1.1) contrast(1.05);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
}

/* Pulse Animations */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.animate-pulse { animation: pulse 2s infinite; }
.animate-pulse-blue { animation: pulse-blue 2s infinite; }

/* Gradient Background */
.gradient-bg {
    background: linear-gradient(-45deg, #121212, #1a1a2e, #16213e, #121212);
    background-size: 300% 300%;
    animation: gradient-slide 20s ease-in-out infinite;
}

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

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s cubic-bezier(0.32, 0.72, 0, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.32, 0.72, 0, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: all 0.7s cubic-bezier(0.32, 0.72, 0, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Cosmos Background */
#cosmos-bg {
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    z-index: -9999;
    background: linear-gradient(200deg, #e0e7ff 0%, #f0f9ff 45%, #e9d5ff 78%, #cffafe 100%);
    pointer-events: none;
    opacity: 0.92;
}

#starfield {
    opacity: 0.07 !important;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent !important;
    overflow-x: hidden;
}

/* Connection Card Copy Animation */
@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.connection-card.copied {
    animation: copySuccess 0.3s ease;
}

/* Hero Badge Float Animation */
@keyframes heroBadgeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}



/* Status Dot Pulse */
@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.server-status-dot.online {
    animation: statusPulse 2s ease-in-out infinite;
}

/* Join Button Ripple */
@keyframes buttonRipple {
    0% { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(4); opacity: 0; }
}

.join-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.join-button:active::after {
    animation: buttonRipple 0.6s ease-out;
}

/* Server Status Card Hover */
.server-status-card {
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.server-status-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 60px -12px rgba(99, 102, 241, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* Connection Card Hover */
.connection-card {
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.connection-card:hover .connection-icon {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* Page Loader - Simple Fade */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

#page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

#loader-title {
    font-family: 'ZCOOL KuaiLe', cursive;
    transition: opacity 1s ease;
}

/* Server Status Card */
.server-status-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    position: relative;
    overflow: hidden;
}

.server-status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7, #0ea5e9);
    background-size: 300% 100%;
    animation: gradientFlow 3s ease infinite;
}

/* Server Status Dot */
.server-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
}

.server-status-dot.online {
    background: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.server-status-dot.offline {
    background: #ef4444;
}

/* Connection Card */
.connection-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.connection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.connection-card.copied {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.connection-card.copied .connection-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.connection-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.connection-ip {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #1e1b4b;
}

.connection-port {
    font-size: 0.75rem;
    color: #64748b;
}

.connection-copy-hint {
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    color: #6366f1;
}

.connection-card:hover .connection-copy-hint {
    opacity: 1;
    transform: translateX(0);
}

/* Join Button */
.join-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    background-size: 200% 200%;
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 1rem;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.join-button::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;
}

.join-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.5), 0 0 60px rgba(168, 85, 247, 0.3);
    background-position: 100% 0;
}

.join-button:hover::before {
    left: 100%;
}

.join-button:active {
    transform: translateY(-1px);
}

.join-button-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.join-button:hover .join-button-icon {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Scroll Indicator */
.scroll-indicator {
    animation: fadeInUp 0.8s ease-out 1.2s both;
}

/* Morphing Background */
.morphing-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
}

.morph-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: morphBlob 20s ease-in-out infinite;
}

.morph-blob-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.2));
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.morph-blob-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(99, 102, 241, 0.2));
    top: 50%;
    right: -150px;
    animation-delay: -5s;
}

.morph-blob-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(236, 72, 153, 0.2));
    bottom: -100px;
    left: 30%;
    animation-delay: -10s;
}

@keyframes morphBlob {
    0%, 100% { transform: translate(0, 0) scale(1); border-radius: 50%; }
    25% { transform: translate(50px, -50px) scale(1.1); border-radius: 60% 40% 40% 60%; }
    50% { transform: translate(0, 50px) scale(0.95); border-radius: 40% 60% 60% 40%; }
    75% { transform: translate(-50px, -25px) scale(1.05); border-radius: 50% 50% 50% 50%; }
}

/* Chapter Navigation Cards */
#chapter-nav {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

#chapter-nav a {
    transition: all 0.3s ease;
}

#chapter-nav a:active {
    transform: scale(0.98);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Transitions for all interactive elements */
a, button {
    transition: all 0.2s ease;
}

/* Fullscreen Overlay */
.fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    overflow-y: auto;
    transition: opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1), transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.5s;
}

.hidden-overlay {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
}

.visible-overlay {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* Staff section styles */
#staff-stars {
    background-image:
        radial-gradient(2px 2px at 20px 30px, #64748b18, transparent),
        radial-gradient(2px 2px at 40px 70px, #64748b18, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
}

/* Hero Section Entrance Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroBadgeSlide {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

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