body { font-family: 'Inter', sans-serif; }

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container { max-width: 900px; }

.glass {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background-color: rgba(0, 0, 0, 0.2);
}

.mobile-menu-overlay {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Comments */
.highlight-comment {
    animation: highlightFade 3s ease-out forwards;
    background-color: rgba(99, 102, 241, 0.2);
    border: 1px solid #6366F1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes highlightFade {
    0% {
        background-color: rgba(99, 102, 241, 0.4);
    }
    100% {
        background-color: transparent;
    }
}

/* Spinner for buttons */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    width: 1em;
    height: 1em;
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5em;
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* :) */
.nickname {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Mobile comments horizontal scroll styles */
#comments-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    #comments-container {
        overflow-x: auto;
        overflow-y: visible;
        padding: 5px 0;
    }

    /* Default width for 1 replies */
    #comments-container > div,
    #comments-container > ul,
    #comments-container > * {
        width: 100%;
    }
    /* Wider width when there is more than 1 reply */
    #comments-container.has-many-comments > div,
    #comments-container.has-many-comments > ul,
    #comments-container.has-many-comments > * {
        width: 700px;
    }
}

/* NSFW overlay */
body.nsfw-locked {
    overflow: hidden;
}

/* Image embedding */
.embedded-media.embedded-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 5px auto;
    object-fit: contain;
    width: 100%;
}

.image-container {
    max-height: 640px;
    overflow: hidden;
}

.image-container .embedded-media.embedded-image {
    max-height: 100%;
    width: auto;
}

/* User mentions */
.mentions-dropdown {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #90A1B9;
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
}

.mentions-dropdown li {
    padding: 4px 8px;
    cursor: pointer;
}

.mentions-dropdown li:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Space Particles Animation for 404 Page */
.space-particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 25%, #16213e 50%, #0f3460 75%, #533483 100%);
}

.space-particles-bg .stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: sparkle 20s linear infinite;
    opacity: 0.4;
}

@keyframes sparkle {
    from { transform: translateY(0px); }
    to { transform: translateY(-100px); }
}

.particles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

.particle:nth-child(odd) {
    background: radial-gradient(circle, rgba(147,51,234,0.6) 0%, rgba(147,51,234,0.3) 50%, transparent 100%);
    animation-duration: 20s;
}

.particle:nth-child(3n) {
    background: radial-gradient(circle, rgba(59,130,246,0.6) 0%, rgba(59,130,246,0.3) 50%, transparent 100%);
    animation-duration: 25s;
}

.particle:nth-child(5n) {
    background: radial-gradient(circle, rgba(236,72,153,0.6) 0%, rgba(236,72,153,0.3) 50%, transparent 100%);
    animation-duration: 18s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Slow bounce animation for the warning icon */
@keyframes bounce-slow {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

/* 404 page content styling */
.page-404-content {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .page-404-content {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid rgba(75, 85, 99, 0.2);
}