/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #111827;
}

::-webkit-scrollbar-thumb {
    background: #7f1d1d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #991b1b;
}

/* Animations */
@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

@keyframes glitch {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

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

.glitch-text:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(127, 29, 29, 0.2);
    border-radius: 12px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message Animations */
.message-enter {
    animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Custom Selection */
::selection {
    background: rgba(220, 38, 38, 0.5);
    color: #fff;
}

/* Chaos Mode Animations */
@keyframes chaos-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(220, 38, 38, 0.5), 0 0 10px rgba(220, 38, 38, 0.3);
        border-color: rgba(220, 38, 38, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.8), 0 0 30px rgba(147, 51, 234, 0.4);
        border-color: rgba(220, 38, 38, 1);
    }
}

.chaos-active {
    animation: chaos-pulse 2s infinite;
}

/* Glitch effect for text */
.glitch-mode {
    position: relative;
}

.glitch-mode::before,
.glitch-mode::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-mode::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    color: #ff0000;
    z-index: -1;
}

.glitch-mode::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-1 {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 0); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 0); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 0); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-2px, 0); }
    100% { clip-path: inset(30% 0 30% 0); transform: translate(2px, 0); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 0); }
    20% { clip-path: inset(30% 0 50% 0); transform: translate(-2px, 0); }
    40% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 0); }
    60% { clip-path: inset(10% 0 70% 0); transform: translate(-2px, 0); }
    80% { clip-path: inset(40% 0 30% 0); transform: translate(2px, 0); }
    100% { clip-path: inset(20% 0 60% 0); transform: translate(-2px, 0); }
}

/* Unlimited mode special styling */
.unlimited-response {
    border-left: 3px solid #ef4444;
    padding-left: 1rem;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.1) 0%, transparent 100%);
}

.unlimited-response::before {
    content: "🔓";
    margin-right: 0.5rem;
}
/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #ef4444 0%, #9333ea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Effect */
.glass {
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Red Glow */
.red-glow {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
}

/* Code Block Styling */
pre {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

code {
    color: #f87171;
    font-family: 'Courier New', monospace;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .prose {
        font-size: 0.95rem;
    }
}

/* Custom cursor for edgy feel */
body {
    cursor: default;
}

button, a, [role="button"] {
    cursor: pointer;
}

textarea {
    cursor: text;
}

/* Hover effects */
.hover-lift {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}