/* Base styles */
:root {
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --metallic-gray: #2c3238;
    --time-circuit-red: #ff1744;
}

/* Fix mobile keyboard issues */
html, body {
    height: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* Prevent iOS Safari from resizing on keyboard */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

/* Time machine container styles */
.container {
    background: linear-gradient(45deg, #1a1c20 0%, var(--metallic-gray) 100%);
    border: 2px solid var(--neon-blue);
    border-radius: 15px;
    box-shadow: 0 0 20px var(--neon-blue);
    padding: 2rem;
    animation: powerPulse 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(0, 243, 255, 0.1), 
        rgba(188, 19, 254, 0.1), 
        transparent
    );
    transform: rotate(45deg);
    animation: lightSweep 8s linear infinite;
    pointer-events: none;
}

/* Time Circuit Panel - Performance Optimized */
.time-circuit-panel {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 2px solid var(--neon-blue);
    border-radius: 15px;
    box-shadow: 
        0 0 15px rgba(0, 243, 255, 0.2),
        inset 0 0 10px rgba(0, 243, 255, 0.1);
    /* Remove heavy animations for better scroll performance */
}

.time-circuit-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    opacity: 0.3;
    /* Remove animation for better performance */
}

.time-circuit-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 70%, rgba(0, 243, 255, 0.05) 100%),
        linear-gradient(0deg, transparent 70%, rgba(188, 19, 254, 0.05) 100%);
    background-size: 50px 50px;
    pointer-events: none;
    opacity: 0.5;
    /* Remove animation for better performance */
}

/* Enhanced Portrait Display - Performance Optimized */
.vintage-frame {
    border: 8px solid var(--metallic-gray);
    border-radius: 15px;
    padding: 1rem;
    margin: 1rem auto;
    max-width: 300px;
    aspect-ratio: 1;
    background: linear-gradient(45deg, #000, var(--metallic-gray));
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
    box-shadow: 
        inset 0 0 15px rgba(0, 243, 255, 0.3),
        0 0 10px rgba(188, 19, 254, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.3);
}

.vintage-frame:hover {
    transform: scale(1.02);
}

.vintage-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 50%, rgba(0, 243, 255, 0.1) 100%),
        linear-gradient(0deg, transparent 50%, rgba(188, 19, 254, 0.1) 100%);
    background-size: 30px 30px;
    animation: matrixScan 20s linear infinite;
    pointer-events: none;
    z-index: 2;
}

/* Holographic Overlay */
.vintage-frame::after {
    content: '';
    position: absolute;
    top: -150%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        transparent,
        rgba(0, 243, 255, 0.2),
        rgba(188, 19, 254, 0.2),
        transparent
    );
    transform: rotate(45deg);
    animation: holoScan 3s linear infinite;
    z-index: 1;
}

/* Chat container styles */
.chat-container {
    height: calc(100vh - 250px);
    min-height: 500px;
    overflow-y: auto;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-purple);
    border-radius: 15px;
    box-shadow: 
        inset 0 0 20px var(--neon-purple),
        0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: bootUp 0.5s ease-out;
    perspective: 1000px;
    transform-style: preserve-3d;
    width: 100%;
    box-sizing: border-box;
}

/* Message styles */
.message {
    margin-bottom: 1rem;
    width: fit-content;
    max-width: 90%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    display: block;
    animation: messageAppear 0.3s ease-out;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.message-user {
    margin-left: auto;
    margin-right: 10px;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    padding: 1rem 1.5rem;
    border-radius: 15px 15px 0 15px;
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 243, 255, 0.5);
    box-sizing: border-box;
    white-space: normal;
    text-align: left;
    transform: translateZ(10px);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(0, 243, 255, 0.5);
    animation: userMessageSlide 0.3s ease-out;
}

.message-bot {
    margin-right: auto;
    margin-left: 10px;
    background: var(--metallic-gray);
    padding: 1rem 1.5rem;
    border-radius: 15px 15px 15px 0;
    border: 1px solid var(--neon-blue);
    color: #fff;
    text-shadow: 0 0 3px rgba(0, 243, 255, 0.5);
    box-sizing: border-box;
    white-space: normal;
    text-align: left;
    transform: translateZ(10px);
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(0, 243, 255, 0.5);
    animation: botMessageSlide 0.3s ease-out;
    position: relative;
    overflow: visible;
}

.message-bot::before {
    content: 'AI GENERATED';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 2.5rem;
    font-weight: bold;
    color: rgba(188, 19, 254, 0.2);
    white-space: nowrap;
    pointer-events: none;
    z-index: -1;
    font-family: monospace;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    animation: watermarkPulse 3s ease-in-out infinite;
}

@keyframes watermarkPulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.25; }
}

.message.admin-message {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    html {
        height: 100%;
        height: calc(var(--vh, 1vh) * 100);
    }
    
    body {
        height: 100%;
        height: calc(var(--vh, 1vh) * 100);
        overflow-x: hidden;
        position: relative;
        width: 100%;
        overflow-y: auto;
    }
    
    .container {
        min-height: calc(var(--vh, 1vh) * 100);
        overflow-y: visible;
        padding: 1rem;
        position: relative;
    }
    
    .chat-container {
        height: calc(var(--vh, 1vh) * 100 - 200px);
        min-height: 400px;
        max-height: calc(var(--vh, 1vh) * 100 - 200px);
        margin: 0;
        width: 100%;
        padding: 1rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .message {
        max-width: 95%;
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }

    .message-user, .message-bot {
        padding: 1rem 1.25rem;
    }
    
    .card {
        border: none;
        margin: 0;
        background: transparent;
        width: 100%;
    }

    .card-body {
        padding: 0.5rem;
        position: relative;
    }

    #chat-section .col-lg-9, 
    #chat-section .col-md-8 {
        padding: 0;
        width: 100%;
    }

    .row.g-4 {
        margin: 0;
        gap: 1rem;
    }
    
    /* Fix input focus issues on mobile */
    #chat-form {
        position: sticky;
        bottom: 0;
        background: rgba(0, 0, 0, 0.9);
        z-index: 100;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    #chat-form .form-control:focus {
        transform: none;
        zoom: 1;
        -webkit-appearance: none;
        -webkit-user-select: text;
    }
    
    /* Prevent viewport zoom on input focus */
    input, textarea, select {
        font-size: 16px;
        -webkit-appearance: none;
        -webkit-border-radius: 0;
        border-radius: 0;
    }
    
    /* Prevent body scroll when keyboard is open */
    body.keyboard-open {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    /* Additional mobile keyboard fixes */
    .container.keyboard-open {
        height: calc(var(--vh, 1vh) * 100);
        overflow: hidden;
    }
    
    /* Prevent double rendering */
    @supports (-webkit-touch-callout: none) {
        .chat-container {
            height: calc(var(--vh, 1vh) * 100 - 200px);
            -webkit-overflow-scrolling: touch;
        }
    }
}

/* Large screen optimizations */
@media (min-width: 1200px) {
    .chat-container {
        height: calc(100vh - 200px);
        min-height: 600px;
        padding: 2rem;
    }
    
    .message {
        max-width: 85%;
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    .message-user, .message-bot {
        padding: 1.25rem 2rem;
    }
    
    .container {
        max-width: 1400px;
    }
}

/* Portrait Gallery Enhancement */
#portrait-gallery {
    min-height: 100px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.portrait-thumbnail {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.portrait-thumbnail:hover {
    transform: translateZ(20px) scale(1.1);
    border-color: var(--neon-blue);
    box-shadow: 
        0 0 15px var(--neon-blue),
        0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Section Transitions */
#start-section, #chat-section {
    transition: opacity 0.5s ease-in-out;
}

#start-section.d-none {
    animation: sectionFadeOut 0.5s ease-out;
}

#chat-section:not(.d-none) {
    animation: sectionFadeIn 0.5s ease-in;
}

/* Button Animations */
.btn {
    background: var(--metallic-gray);
    border: 2px solid var(--neon-purple);
    color: var(--neon-purple);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, rgba(188, 19, 254, 0.2), transparent);
    animation: buttonScan 2s linear infinite;
    z-index: -1;
}

.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(188, 19, 254, 0.1) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease-out;
    z-index: -1;
}

.btn:hover {
    background: var(--neon-purple);
    color: #fff;
    box-shadow: 
        0 0 15px var(--neon-purple),
        0 0 30px var(--neon-purple);
    transform: translateY(-2px) scale(1.05);
}

.btn:hover::after {
    transform: scale(1);
}

/* Keyframe Animations */
@keyframes powerPulse {
    0%, 100% { box-shadow: 0 0 20px var(--neon-blue); }
    50% { box-shadow: 0 0 30px var(--neon-blue); }
}

@keyframes scanLine {
    0% { top: -100%; }
    100% { top: 200%; }
}

@keyframes circuitScan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes buttonScan {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

@keyframes frameFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}


@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) translateZ(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateZ(10px);
    }
}

@keyframes userMessageSlide {
    0% {
        opacity: 0;
        transform: translateX(50px) translateZ(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateZ(10px);
    }
}

@keyframes botMessageSlide {
    0% {
        opacity: 0;
        transform: translateX(-50px) translateZ(-10px);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateZ(10px);
    }
}

@keyframes sectionFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes sectionFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes panelBoot {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bootUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lightSweep {
    0% { left: -150%; }
    100% { left: 150%; }
}

@keyframes panelFloat {
    0%, 100% { 
        transform: translateY(0) scale(1); 
        box-shadow: 
            0 0 20px rgba(0, 243, 255, 0.2),
            inset 0 0 15px rgba(0, 243, 255, 0.2);
    }
    50% { 
        transform: translateY(-10px) scale(1.02); 
        box-shadow: 
            0 10px 30px rgba(0, 243, 255, 0.3),
            inset 0 0 20px rgba(0, 243, 255, 0.3);
    }
}

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

@keyframes titleBoot {
    0% {
        opacity: 0;
        letter-spacing: 2px;
        filter: blur(2px);
        transform: scale(0.98);
    }
    30% {
        opacity: 0.3;
        letter-spacing: 1px;
        filter: blur(1px);
        transform: scale(0.99);
    }
    100% {
        opacity: 1;
        letter-spacing: normal;
        filter: blur(0);
        transform: scale(1);
    }
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 
            0 0 10px var(--neon-blue),
            0 0 20px var(--neon-blue);
    }
    50% {
        text-shadow: 
            0 0 15px var(--neon-blue),
            0 0 25px var(--neon-blue);
    }
}

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

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
}

@keyframes subtitleFade {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.6;
    }
}

.portrait-icon {
    width: 64px;
    height: 64px;
    color: var(--neon-blue);
    filter: drop-shadow(0 0 5px var(--neon-blue));
}

.form-control {
    background: var(--metallic-gray);
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    border-radius: 5px;
    padding: 0.5rem 1rem;
}

.form-control:focus {
    box-shadow: 0 0 15px var(--neon-blue);
    background: rgba(0, 243, 255, 0.1);
}

#loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.spinner-border {
    color: var(--neon-blue) !important;
    width: 3rem;
    height: 3rem;
    border-width: 0.25rem;
    filter: drop-shadow(0 0 10px var(--neon-blue));
}

.card {
    background: linear-gradient(45deg, #1a1c20 0%, var(--metallic-gray) 100%);
    border: none;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

.card-header {
    border-bottom: 2px solid var(--neon-blue);
    background: rgba(0, 243, 255, 0.1);
}

.mood-display {
    font-family: "Press Start 2P", cursive;
    font-size: 0.7rem;
    color: var(--neon-purple);
    text-shadow: 0 0 5px var(--neon-purple);
    margin-top: 0.5rem;
}

.time-circuit-title {
    font-family: "Press Start 2P", cursive;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    animation: titleBoot 3s cubic-bezier(0.215, 0.61, 0.355, 1), titleGlow 4s ease-in-out infinite;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.title-main {
    font-size: 1em;
    font-weight: bold;
    letter-spacing: 0.15em;
    background: linear-gradient(45deg, var(--neon-blue), #00f5ff, var(--neon-purple));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGradient 3s ease-in-out infinite, titlePulse 2s ease-in-out infinite;
    text-shadow: none;
}

.title-subtitle {
    font-family: 'Georgia', serif;
    font-size: 0.35em;
    font-weight: normal;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    letter-spacing: 0.05em;
    font-style: italic;
    opacity: 0.9;
    animation: subtitleFade 4s ease-in-out infinite;
}

.unrated-label {
    display: inline-block;
    background: #cc0000;
    color: white;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 0.2em;
    padding: 0.4em 0.8em;
    border: 2px solid #990000;
    border-radius: 4px;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    letter-spacing: 0.1em;
    margin-top: 0.5em;
    animation: none;
    transform: rotate(-3deg);
    position: relative;
    align-self: flex-end;
}

.header-text {
    font-family: "Press Start 2P", cursive;
    font-size: 0.8rem;
}

/* Floating Navigation Styles */
.floating-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: linear-gradient(45deg, #1a1c20 0%, var(--metallic-gray) 100%);
    border-right: 2px solid var(--neon-blue);
    box-shadow: 5px 0 15px rgba(0, 243, 255, 0.2);
    z-index: 1050;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
}

.floating-nav.active {
    left: 0;
}

.floating-nav-content {
    padding: 1rem;
}

.nav-header {
    padding: 1rem;
    border-bottom: 1px solid var(--neon-blue);
    margin-bottom: 1rem;
}

.nav-title {
    color: var(--neon-blue);
    margin: 0;
    font-size: 1.1rem;
    font-family: "Press Start 2P", cursive;
}

.floating-nav .nav-link {
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border-radius: 5px;
}

.floating-nav .nav-link:hover {
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-blue);
    transform: translateX(5px);
}

.floating-nav .feather {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    stroke: currentColor;
}

/* Menu Toggle Button */
.menu-toggle-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1060;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--metallic-gray);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--neon-blue);
    transition: all 0.3s ease;
}

.menu-toggle-btn:hover {
    box-shadow: 0 0 15px var(--neon-blue);
    transform: scale(1.1);
}

.menu-toggle-btn .hamburger {
    position: relative;
    width: 20px;
    height: 2px;
    background: var(--neon-blue);
    transition: all 0.3s ease;
}

.menu-toggle-btn .hamburger::before,
.menu-toggle-btn .hamburger::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: var(--neon-blue);
    transition: all 0.3s ease;
}

.menu-toggle-btn .hamburger::before {
    transform: translateY(-6px);
}

.menu-toggle-btn .hamburger::after {
    transform: translateY(6px);
}

.menu-toggle-btn.active .hamburger {
    background: transparent;
}

.menu-toggle-btn.active .hamburger::before {
    transform: rotate(45deg);
}

.menu-toggle-btn.active .hamburger::after {
    transform: rotate(-45deg);
}

/* Adjust container padding for menu */
.container {
    transition: margin-left 0.3s ease-in-out;
}

@media (min-width: 992px) {
    .floating-nav.active + .container {
        margin-left: 280px;
    }
}

/* Add hover effects for nav items */
.floating-nav .nav-item {
    position: relative;
    margin: 0.25rem 0;
}

.floating-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--neon-blue);
    transition: width 0.3s ease;
}

.floating-nav .nav-link:hover::after {
    width: 100%;
}

/* Animation for menu items */
.floating-nav.active .nav-item {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.floating-nav.active .nav-item:nth-child(1) { animation-delay: 0.1s; }
.floating-nav.active .nav-item:nth-child(2) { animation-delay: 0.2s; }
.floating-nav.active .nav-item:nth-child(3) { animation-delay: 0.3s; }
.floating-nav.active .nav-item:nth-child(4) { animation-delay: 0.4s; }


/* Add these styles at the end of the file */
.portrait-history {
    padding: 1rem;
    border-top: 1px solid var(--neon-blue);
    margin-top: 1rem;
}

.portrait-thumbnail img {
    transition: all 0.3s ease;
}

.portrait-thumbnail:hover img {
    filter: brightness(1.2);
}

/* New Animation Keyframes */
@keyframes holoScan {
    0% { transform: rotate(45deg) translateY(-100%); }
    100% { transform: rotate(45deg) translateY(100%); }
}

/* Time Circuit Button Styles */
.btn-regenerate.time-circuit-btn {
    background: var(--metallic-gray);
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 0.75rem 1.5rem;
    font-family: "Press Start 2P", cursive;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem auto;
    z-index: 2;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.btn-regenerate.time-circuit-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 243, 255, 0.1) 10px,
        rgba(0, 243, 255, 0.1) 20px
    );
    animation: circuit-pattern 20s linear infinite;
    z-index: 1;
    opacity: 0.5;
}

.btn-regenerate.time-circuit-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 
        0 0 15px var(--neon-blue),
        0 0 30px var(--neon-blue),
        inset 0 0 10px var(--neon-blue);
    color: #fff;
    text-shadow: 0 0 5px var(--neon-blue);
}

.btn-regenerate.time-circuit-btn:hover .feather {
    animation: spin 1s linear infinite;
}

.btn-regenerate.time-circuit-btn .btn-text {
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-regenerate.time-circuit-btn .feather {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 2px var(--neon-blue));
}

/* Terms of Service Modal Styling - Optimized */
#termsModal .modal-content {
    background: linear-gradient(45deg, #1a1c20 0%, var(--metallic-gray) 100%);
    border: 2px solid var(--neon-blue);
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    color: #fff;
}

#termsModal .modal-dialog {
    /* Remove transforms for better performance */
}

#termsModal .modal-backdrop {
    /* Remove transforms for better performance */
}

#termsModal .modal-header {
    border-bottom: 1px solid var(--neon-blue);
    background: rgba(0, 243, 255, 0.1);
}

#termsModal .modal-title {
    color: var(--neon-blue);
    font-family: "Press Start 2P", cursive;
    font-size: 1rem;
    text-shadow: 0 0 10px var(--neon-blue);
}

#termsModal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

#termsModal .terms-content h6 {
    color: var(--neon-purple);
    font-family: "Press Start 2P", cursive;
    font-size: 0.8rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 5px var(--neon-purple);
}

#termsModal .terms-content p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

#termsModal .terms-content ul {
    margin-left: 1rem;
    margin-bottom: 1rem;
}

#termsModal .terms-content li {
    margin-bottom: 0.5rem;
    list-style-type: none;
    position: relative;
    padding-left: 1rem;
}

#termsModal .terms-content li::before {
    content: "▶";
    color: var(--neon-blue);
    position: absolute;
    left: 0;
}

#termsModal .alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #ffc107;
    border-radius: 8px;
}

#termsModal .form-check-input:checked {
    background-color: var(--neon-blue);
    border-color: var(--neon-blue);
}

#termsModal .form-check-label {
    color: var(--neon-blue);
    font-weight: bold;
}

#termsModal .modal-footer {
    border-top: 1px solid var(--neon-blue);
    background: rgba(0, 243, 255, 0.05);
}

#termsModal .btn-primary {
    background: var(--neon-blue);
    border-color: var(--neon-blue);
    color: #000;
    font-weight: bold;
}

#termsModal .btn-primary:hover {
    background: #fff;
    border-color: #fff;
    color: #000;
    box-shadow: 0 0 15px var(--neon-blue);
}

#termsModal .btn-outline-secondary {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
}

#termsModal .btn-outline-secondary:hover {
    background: var(--neon-purple);
    border-color: var(--neon-purple);
    color: #fff;
}

/* Input form improvements */
#chat-form {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--neon-blue);
    margin-top: auto;
}

#chat-form .input-group {
    background: rgba(44, 50, 56, 0.9);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(0, 243, 255, 0.3);
    transition: all 0.3s ease;
}

#chat-form .input-group:focus-within {
    border-color: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

#chat-form .form-control {
    background: transparent;
    border: none;
    color: #fff;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    min-height: 50px;
}

#chat-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#chat-form .form-control:focus {
    box-shadow: none;
    background: transparent;
    color: #fff;
}

#chat-form .btn {
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    border: none;
    color: #fff;
    padding: 1rem 1.5rem;
    min-height: 50px;
    transition: all 0.3s ease;
}

#chat-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.3);
}

@keyframes circuit-pattern {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

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

/* Add glowing effect when regenerating */
.btn-regenerate.time-circuit-btn:disabled {
    animation: regenerating-pulse 2s infinite;
    opacity: 0.8;
}

@keyframes regenerating-pulse {
    0%, 100% {
        box-shadow: 
            0 0 15px var(--neon-blue),
            0 0 30px var(--neon-blue),
            inset 0 0 10px var(--neon-blue);
    }
    50% {
        box-shadow: 
            0 0 25px var(--neon-blue),
            0 0 50px var(--neon-blue),
            inset 0 0 20px var(--neon-blue);
    }
}

/* Add floating portrait styles */
.floating-portrait {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    width: 200px;
}

.floating-portrait.visible {
    opacity: 0.5;
    transform: translateY(0);
    pointer-events: auto;
}

.floating-portrait:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.floating-portrait-inner {
    background: linear-gradient(45deg, #1a1c20 0%, var(--metallic-gray) 100%);
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    padding:0.5rem;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    aspect-ratio: 1;
}

.floating-portrait #floating-portrait-placeholder {
    width: 100%;
    height: 100%;
}

.floating-portrait #floating-portrait-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.floating-portrait .mood-display {
    font-size: 0.6rem;
    margin-top: 0.25rem;
}

/* Add these styles at the end of the file */

/* Countdown Timer Styles */
.countdown-timer {
    position: fixed;
    top:50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(44, 50, 56, 0.95);
    padding: 3rem;
    border-radius: 15px;
    border: 2px solid var(--neon-blue);
    text-align: center;
    z-index: 1100;
    backdrop-filter: blur(10px);
    box-shadow: 
        0 0 20px var(--neon-blue),
        inset 0 0 15px var(--neon-blue);
    display: none;
    width: 300px;
    height: 300px;
}

.countdown-timer.active {
    display: block;
    animation: countdownFadeIn 0.3s ease-in-out;
}

.countdown-timer .message {
    font-family: "Press Start 2P", cursive;
    font-size: 0.8rem;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 0 5px var(--neon-blue);
}

/* Enhanced Flux Capacitor */
.flux-capacitor {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 2rem;
    background: linear-gradient(
        45deg,
        var(--metallic-gray) 0%,
        rgba(44, 50, 56, 0.9) 50%,
        var(--metallic-gray) 100%
    );
    border-radius: 50%;
    border: 3px solid var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue);
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
    perspective: 1000px;
    animation: fluxRotate 20s linear infinite;
    overflow: visible;
}

.flux-center {
    width: 30px;
    height: 30px;
    background: radial-gradient(
        circle at center,
        #fff 0%,
        var(--neon-blue) 50%,
        transparent 100%
    );
    border-radius: 50%;
    position: absolute;
    animation: pulseFlux 2s infinite;
    box-shadow: 0 0 20px var(--neon-blue);
    z-index: 2;
}

/* Multiple center rings */
.flux-center::before,
.flux-center::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
}

.flux-center::before {
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 2px solid var(--neon-blue);
    animation: centerRing 3s infinite;
}

.flux-center::after {
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    border: 3px solid var(--neon-purple);
    animation: centerRingReverse 4s infinite;
}

/* Energy arcs */
.flux-arc {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--neon-blue);
    animation: arcSpin 4s linear infinite;
    z-index: 1;
}

.flux-arc::before {
    content: '';
    position: absolute;
    top: -2px;
    width: 10px;
    height: 10px;
    background: var(--neon-blue);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-blue);
    animation: arcPoint 4s linear infinite;
}

.flux-arc:nth-child(2) {
    transform: rotate(120deg);
    animation-delay: -1.33s;
}

.flux-arc:nth-child(3) {
    transform: rotate(240deg);
    animation-delay: -2.66s;
}

/* Enhanced lines */
.flux-line {
    position: absolute;
    width: 60px;
    height: 4px;
    background: var(--neon-blue);
    transform-origin: center;
    z-index: 2;
}

.flux-line::before,
.flux-line::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 100%;
}

.flux-line::before {
    background: var(--neon-blue);
    filter: blur(4px);
    opacity: 0.5;
    animation: lineGlow 2s infinite;
}

.flux-line::after {
    background: #fff;
    height: 2px;
    opacity: 0.3;
    filter: blur(2px);
    animation: lineFlash 2s infinite;
}

.flux-line:nth-child(1) { 
    transform: rotate(0deg); 
    animation: linePulse 2s infinite;
}
.flux-line:nth-child(2) { 
    transform: rotate(120deg); 
    animation: linePulse 2s infinite 0.66s;
}
.flux-line:nth-child(3) { 
    transform: rotate(240deg); 
    animation: linePulse 2s infinite 1.33s;
}

/* Enhanced points */
.flux-point {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(
        circle at center,
        #fff 0%,
        var(--neon-blue) 60%,
        transparent 100%
    );
    border-radius: 50%;
    animation: chargePoint 2s infinite;
    box-shadow: 
        0 0 15px var(--neon-blue),
        0 0 30px var(--neon-blue);
    z-index: 3;
}

.flux-point::before,
.flux-point::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.flux-point::before {
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--neon-blue);
    animation: pointRing 2s infinite;
}

.flux-point::after {
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 2px solid var(--neon-purple);
    animation: pointRingReverse 3s infinite;
}

/* Particle effects */
.flux-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-blue);
    border-radius: 50%;
    opacity: 0;
}

/* Point positioning and timing */
.flux-point:nth-child(4) { transform: translate(60px, 0); animation-delay: 0s; }
.flux-point:nth-child(5) { transform: rotate(120deg) translate(60px, 0); animation-delay: 0.66s; }
.flux-point:nth-child(6) { transform: rotate(240deg) translate(60px, 0); animation-delay: 1.33s; }

/* New animations */
@keyframes arcSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes arcPoint {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.5;
    }
    50% { 
        transform: scale(1.5);
        opacity: 1;
    }
}

@keyframes centerRingReverse {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        opacity: 0.6;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0.3;
    }
}

@keyframes lineFlash {
    0%, 100% {
        opacity: 0;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.6;
        transform: scaleY(1.5);
    }
}

@keyframes pointRingReverse {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 0.3;
    }
}

/* Update existing animations */
@keyframes pulseFlux {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 
            0 0 20px var(--neon-blue),
            0 0 40px var(--neon-blue);
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        box-shadow: 
            0 0 40px var(--neon-blue),
            0 0 60px var(--neon-blue);
    }
}

@keyframes chargePoint {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.8) translate(60px, 0);
        box-shadow: 
            0 0 15px var(--neon-blue),
            0 0 30px var(--neon-blue);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translate(50px, 0);
        box-shadow: 
            0 0 30px var(--neon-blue),
            0 0 50px var(--neon-blue);
    }
}

.time-vortex {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    overflow: hidden;
    opacity: 0.15;
}

.time-vortex::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-conic-gradient(
        from 0deg,
        var(--neon-blue) 0deg 10deg,
        transparent 10deg 20deg
    );
    animation: vortexSpin 10s linear infinite;
}

.time-vortex::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at center,
        transparent 0%,
        rgba(0, 243, 255, 0.1) 50%,
        transparent 100%
    );
    animation: vortexPulse 4s ease-in-out infinite;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
}

.progress-ring::before,
.progress-ring::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid transparent;
    border-radius: 15px;
}

.progress-ring::before {
    border-top-color: var(--neon-blue);
    animation: progressRing 2s linear infinite;
}

.progress-ring::after {
    border-bottom-color: var(--neon-purple);
    animation: progressRingReverse 3s linear infinite;
}

/* Enhanced Animations */
@keyframes pulseFlux {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 
            0 0 20px var(--neon-blue),
            0 0 40px var(--neon-blue);
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        box-shadow: 
            0 0 40px var(--neon-blue),
            0 0 60px var(--neon-blue);
    }
}

@keyframes centerRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes lineGlow {
    0%, 100% {
        opacity: 0.5;
        filter: blur(4px);
    }
    50% {
        opacity: 1;
        filter: blur(8px);
    }
}

@keyframes linePulse {
    0%, 100% {
        transform: scaleX(1) rotate(var(--rotation, 0deg));
    }
    50% {
        transform: scaleX(1.2) rotate(var(--rotation, 0deg));
    }
}

@keyframes chargePoint {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.8) translate(60px, 0);
        box-shadow: 
            0 0 15px var(--neon-blue),
            0 0 30px var(--neon-blue);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translate(50px, 0);
        box-shadow: 
            0 0 30px var(--neon-blue),
            0 0 50px var(--neon-blue);
    }
}

@keyframes pointRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes vortexSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes vortexPulse {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }
}

@keyframes progressRing {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes progressRingReverse {
    0% {
        transform: rotate(360deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

/* Enhanced Animations */
@keyframes pulseFlux {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 
            0 0 20px var(--neon-blue),
            0 0 40px var(--neon-blue);
    }
    50% {
        transform: scale(1.3) rotate(180deg);
        box-shadow: 
            0 0 40px var(--neon-blue),
            0 0 60px var(--neon-blue);
    }
}

@keyframes centerRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes lineGlow {
    0%, 100% {
        opacity: 0.5;
        filter: blur(4px);
    }
    50% {
        opacity: 1;
        filter: blur(8px);
    }
}

@keyframes linePulse {
    0%, 100% {
        transform: scaleX(1) rotate(var(--rotation, 0deg));
    }
    50% {
        transform: scaleX(1.2) rotate(var(--rotation, 0deg));
    }
}

@keyframes chargePoint {
    0%, 100% {
        opacity: 0.5;
        transform: scale(0.8) translate(60px, 0);
        box-shadow: 
            0 0 15px var(--neon-blue),
            0 0 30px var(--neon-blue);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) translate(50px, 0);
        box-shadow: 
            0 0 30px var(--neon-blue),
            0 0 50px var(--neon-blue);
    }
}

@keyframes pointRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes vortexSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes vortexPulse {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }
}

@keyframes progressRing {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes progressRingReverse {
    0% {
        transform: rotate(360deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

@keyframes fluxRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes countdownFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.form-control:disabled {
    background: rgba(44, 50, 56, 0.5);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.floating-glass-chat {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width:380px;
    background: rgba(44, 50, 56, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: 
        0 8px 32px 0 rgba(0, 243, 255, 0.2),
        inset 0 0 32px rgba(188, 19, 254, 0.1);
    padding: 20px;
    transform: translateY(200%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.floating-glass-chat.active {
    transform: translateY(0);
    opacity: 1;
}

.floating-glass-chat .input-group {
    background: rgba(44, 50, 56, 0.9);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.floating-glass-chat .form-control {
    background: transparent;
    border: none;
    color: #fff;
    padding: 12px 15px;
}

.floating-glass-chat .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.floating-glass-chat .btn {
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    border: none;
    color: #fff;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.floating-glass-chat .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.3);
}

.floating-glass-chat .header {
    margin-bottom: 15px;
    color: var(--neon-blue);
    font-family: "Press Start 2P", cursive;
    font-size: 0.8rem;
    text-shadow: 0 0 5px var(--neon-blue);
}

.floating-glass-chat.fade-out {
    animation: fadeOutDown 0.5s forwards;
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

/* Creative/Strict Slider Styles */
.cfg-scale-control {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
    backdrop-filter: blur(5px);
}

.cfg-scale-control .form-label {
    color: var(--neon-blue);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
}

.cfg-scale-value {
    color: var(--neon-purple);
    font-weight: bold;
    text-shadow: 0 0 3px rgba(188, 19, 254, 0.5);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.slider-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

.cfg-scale-slider {
    flex: 1;
    height: 6px;
    background: linear-gradient(90deg, 
        var(--neon-purple) 0%, 
        rgba(0, 243, 255, 0.5) 50%, 
        var(--neon-blue) 100%);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.cfg-scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    transition: all 0.3s ease;
}

.cfg-scale-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.8);
}

.cfg-scale-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    transition: all 0.3s ease;
}

.cfg-scale-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.8);
}

.cfg-scale-description {
    margin-top: 5px;
}

.cfg-scale-description small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

/* Chat-specific CFG control styling */
.chat-cfg-control {
    margin-top: 0;
    border-color: rgba(0, 243, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.chat-cfg-control .form-label {
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.chat-cfg-control .slider-container {
    gap: 10px;
    margin-bottom: 0;
}

.chat-cfg-control .slider-label {
    font-size: 0.75rem;
    min-width: 45px;
}

/* Sacred Geometry Base */
.sacred-geometry {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: rotateGeometry 40s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.flower-of-life {
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    animation: pulseGeometry 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.flower-of-life::before,
.flower-of-life::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 33.33% 33.33%, transparent 9%, var(--neon-blue) 10%, transparent 11%) 0 0,
        radial-gradient(circle at 66.66% 33.33%, transparent 9%, var(--neon-blue) 10%, transparent 11%) 0 0,
        radial-gradient(circle at 33.33% 66.66%, transparent 9%, var(--neon-blue) 10%, transparent 11%) 0 0,
        radial-gradient(circle at 66.66% 66.66%, transparent 9%, var(--neon-blue) 10%, transparent 11%) 0 0;
    background-size: 33.33% 33.33%;
    opacity: 0.3;
    transform-origin: center;
}

.flower-of-life::before {
    animation: flowerRotate 10s linear infinite;
}

.flower-of-life::after {
    animation: flowerRotateReverse 15s linear infinite;
    opacity: 0.2;
    filter: blur(1px);
}

/* Sacred Triangles - Enhanced */
.sacred-triangles {
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    animation: rotateSacred 15s linear infinite;
}

.sacred-triangle {
    position: absolute;
    width: 90%;
    height: 90%;
    top: 5%;
    left: 5%;
    border: 2px solid var(--neon-blue);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: trianglePulse 3s infinite;
}

.sacred-triangle::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 10%, 5% 95%, 95% 95%);
    background: linear-gradient(45deg, transparent, var(--neon-blue), transparent);
    opacity: 0.2;
    filter: blur(2px);
    animation: innerTrianglePulse 3s infinite;
}

/* Fibonacci Spiral - Enhanced */
.fibonacci-spiral {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotateSpiral 30s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.fibonacci-segment {
    position: absolute;
    border: none;
    width: 100%;
    height: 100%;
    transform-origin: center;
}

.fibonacci-segment::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--neon-blue);
    border-radius: 0 100% 0 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    animation: spiralGlow 4s infinite;
}

.fibonacci-segment:nth-child(1) { transform: rotate(0deg) scale(1); }
.fibonacci-segment:nth-child(2) { transform: rotate(90deg) scale(0.618); }
.fibonacci-segment:nth-child(3) { transform: rotate(180deg) scale(0.382); }
.fibonacci-segment:nth-child(4) { transform: rotate(270deg) scale(0.236); }

/* Outer Ring Enhancements */
.outer-rings {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    border-radius: 50%;
    animation: rotateRings 30s linear infinite;
}

.outer-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-radius: 50%;
}

.outer-ring:nth-child(1) {
    border-color: var(--neon-blue);
    animation: pulseRing 4s ease-in-out infinite;
}

.outer-ring:nth-child(2) {
    width: 95%;
    height: 95%;
    top: 2.5%;
    left: 2.5%;
    border-color: var(--neon-purple);
    animation: pulseRing 4s ease-in-out infinite 1s;
}

.outer-ring:nth-child(3) {
    width: 90%;
    height: 90%;
    top: 5%;
    left: 5%;
    border-color: var(--time-circuit-red);
    animation: pulseRing 4s ease-in-out infinite 2s;
}

/* Sacred Symbols */
.sacred-symbols {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotateSymbols 25s linear infinite;
}

.sacred-symbol {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--neon-blue);
    transform-origin: center;
}

.sacred-symbol::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: var(--neon-blue);
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    opacity: 0.3;
    animation: symbolGlow 3s infinite;
}

/* Enhanced Animations */
@keyframes flowerRotate {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1.1); }
}

@keyframes flowerRotateReverse {
    from { transform: rotate(360deg) scale(1.1); }
    to { transform: rotate(0deg) scale(1); }
}

@keyframes innerTrianglePulse {
    0%, 100% {
        opacity: 0.2;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.4;
        transform: scale(1);
    }
}

@keyframes rotateRings {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
        filter: blur(1px);
    }
    50% {
        transform: scale(1.05);
        opacity: 0.6;
        filter: blur(2px);
    }
}

@keyframes rotateSymbols {
    from { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(0.9); }
    to { transform: rotate(360deg) scale(1); }
}

@keyframes symbolGlow {
    0%, 100% {
        opacity: 0.3;
        filter: blur(1px);
    }
    50% {
        opacity: 0.6;
        filter: blur(2px);
    }
}

/* Add to the end of style.css */

/* Sacred Rings Enhancement */
.sacred-rings {
    position: absolute;
    width: 160%;
    height: 160%;
    top: -30%;
    left: -30%;
    animation: rotateRings 40s linear infinite reverse;
}

.sacred-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--neon-blue);
    border-radius: 50%;
    opacity: 0.3;
}

.sacred-ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--neon-purple);
    border-radius: 50%;animation: ringPulse 3s infinite;
}

.sacred-ring:nth-child(1) { transform: rotate(0deg); }
.sacred-ring:nth-child(2) { transform: rotate(60deg); }
.sacred-ring:nth-child(3) { transform: rotate(120deg); }

/* Sacred Grid Enhancement */
.sacred-grid {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    animation: rotateGrid 30s linear infinite;
}

.grid-line {
    position: absolute;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--neon-blue),
        transparent
    );
    opacity: 0.2;
}

.grid-line:nth-child(1) { transform: rotate(0deg) translateY(0); }
.grid-line:nth-child(2) { transform: rotate(60deg) translateY(0); }
.grid-line:nth-child(3) { transform: rotate(120deg) translateY(0); }

/* New Animations */
@keyframes ringPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.4;
    }
}

@keyframes rotateGrid {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}