/* Custom stylesheet for ZenAI - Roleplay Character Hub */

/* Base overrides and layout configurations */
body {
    background-color: #030712; /* Fallback */
    background-image: radial-gradient(circle at center, #0a1128 0%, #030712 100%);
    position: relative;
    overflow-x: hidden;
}

/* Glassmorphism panel styling */
.glass-panel {
    background: rgba(10, 20, 38, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

/* Glassmorphism input styling */
input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 15px rgba(111, 255, 233, 0.15);
}

/* Glowing background animated orbs */
.background-orbs {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    mix-blend-mode: screen;
}

.orb-1 {
    width: 45vw;
    height: 45vw;
    background: radial-gradient(circle, #00f2fe 0%, #4facfe 100%);
    top: -15%;
    left: -10%;
    animation: floating-slow 25s infinite alternate ease-in-out;
}

.orb-2 {
    width: 35vw;
    height: 35vw;
    background: radial-gradient(circle, #00f2fe 0%, #2575fc 100%);
    bottom: -10%;
    right: -10%;
    animation: floating-slow 30s infinite alternate-reverse ease-in-out;
}

.orb-3 {
    width: 25vw;
    height: 25vw;
    background: radial-gradient(circle, #6fffe9 0%, #5bc0be 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulsing 18s infinite ease-in-out;
}

@keyframes floating-slow {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    50% {
        transform: translate(8%, 10%) rotate(180deg);
    }
    100% {
        transform: translate(-5%, -5%) rotate(360deg);
    }
}

@keyframes pulsing {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.1;
    }
    50% {
        transform: translate(-45%, -55%) scale(1.1);
        opacity: 0.2;
    }
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(111, 255, 233, 0.15);
    border-radius: 10px;
    transition: background 0.3s;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(111, 255, 233, 0.4);
}

/* Chat bubble aesthetics */
.glass-bubble-sent {
    background: linear-gradient(135deg, rgba(28, 37, 65, 0.7) 0%, rgba(58, 80, 107, 0.7) 100%);
    border: 1px solid rgba(111, 255, 233, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 18px 18px 2px 18px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.glass-bubble-received {
    background: rgba(3, 7, 18, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 18px 18px 18px 2px;
}

/* Typing Indicator Animation */
.typing-dots .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    display: inline-block;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

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

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

@keyframes typing-bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1.0);
    }
}

/* Text Formatting Styles in Chat Bubbles */
.message-content {
    font-size: var(--chat-font-size, 0.875rem);
}
.message-content p {
    margin-bottom: 0.5rem;
}
.message-content p:last-child {
    margin-bottom: 0;
}
.message-content strong {
    color: #ffffff;
    font-weight: 700;
}
.message-content em {
    color: #e2e8f0;
    font-style: italic;
}
.message-content code {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.15rem 0.35rem;
    border-radius: 6px;
    color: #6fffe9;
    font-size: 0.85em;
    border: 1px solid rgba(111, 255, 233, 0.1);
}
.message-content pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    margin: 0.5rem 0;
    overflow-x: auto;
}
.message-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    color: #cbd5e1;
}
.message-content ul, .message-content ol {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}
.message-content ul {
    list-style-type: disc;
}
.message-content ol {
    list-style-type: decimal;
}
.message-content li {
    margin-bottom: 0.25rem;
}
.message-content a {
    color: #6fffe9;
    text-decoration: underline;
    transition: color 0.2s;
}
.message-content a:hover {
    color: #5bc0be;
}
.message-content blockquote {
    border-left: 3px solid #5bc0be;
    padding-left: 0.75rem;
    color: #94a3b8;
    font-style: italic;
    margin: 0.5rem 0;
}

/* Selection aesthetics */
::selection {
    background-color: rgba(111, 255, 233, 0.3);
    color: #ffffff;
}

/* Modal activation effects */
.modal-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.modal-active > div {
    transform: scale(1) !important;
}

#prompt-modal > div, #settings-modal > div {
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Floating animation for active list elements */
.character-item-active {
    background: linear-gradient(90deg, rgba(111, 255, 233, 0.12) 0%, rgba(58, 80, 107, 0.2) 100%) !important;
    border-color: rgba(111, 255, 233, 0.4) !important;
    box-shadow: 0 0 15px rgba(111, 255, 233, 0.1) !important;
}

/* Markdown and italicization helper styles (important for roleplay thoughts *like this*) */
.thought-text {
    color: #94a3b8;
    font-style: italic;
}

/* Enhances readability of roleplay thoughts/actions inside user sent bubbles */
.glass-bubble-sent .thought-text {
    color: #a5f3fc;
}

/* Custom transitions and scroll behaviors */
html {
    scroll-behavior: smooth;
}

/* Dynamic element animations */
.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

