/* style.css - Lebendige N.A.I.A. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, #667eea33 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #764ba233 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, #f093fb33 0%, transparent 50%);
    animation: backgroundPulse 8s ease-in-out infinite alternate;
    z-index: -2;
}

@keyframes backgroundPulse {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.1); }
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.6);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(odd) {
    background: rgba(240, 147, 251, 0.6);
    animation-duration: 8s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    50% { transform: translateY(-100px) rotate(180deg); }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Glassmorphism effect */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmerTop 3s ease-in-out infinite;
}

@keyframes shimmerTop {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: rotate 10s linear infinite;
    z-index: 1;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.header-content {
    position: relative;
    z-index: 2;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGlow 3s ease-in-out infinite alternate;
    letter-spacing: 2px;
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 10px rgba(255,255,255,0.3)); }
    100% { filter: drop-shadow(0 0 20px rgba(255,255,255,0.6)); }
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    animation: subtitleFloat 4s ease-in-out infinite;
}

@keyframes subtitleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

/* NAIA Avatar */
.naia-avatar {
    position: absolute;
    top: 32px;
    right: 30px;
    width: 120px; /* Increased size */
    height: 120px; /* Increased size */
    border-radius: 50%;
    opacity: 0.85; /* Slightly transparent */
    border: 3px solid rgba(255, 255, 255, 0.3);
    animation: avatarPulse 2s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    z-index: 3;
    object-fit: cover; /* Ensure the image fits well within the circular frame */
    transition: opacity 0.3s ease; /* Smooth opacity transitions */
}

.naia-avatar:hover {
    opacity: 1; /* Full opacity on hover to indicate interaction */
}

@keyframes avatarPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4); }
    50% { transform: scale(1.1); box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6); }
}

.naia-avatar::before {
    content: '';
    position: absolute;
    top: -12px; /* Adjusted for larger avatar */
    left: -12px; /* Adjusted for larger avatar */
    right: -12px; /* Adjusted for larger avatar */
    bottom: -12px; /* Adjusted for larger avatar */
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb) border-box;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: borderSpin 3s linear infinite;
}

@keyframes borderSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
}

.chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 10% 20%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(240, 147, 251, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.message {
    margin-bottom: 25px;
    animation: messageSlideIn 0.5s ease-out;
    position: relative;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message-content {
    padding: 20px 25px;
    border-radius: 20px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.6;
    position: relative;
    backdrop-filter: blur(10px);
}

.user-message .message-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    color: white;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    animation: userMessageGlow 0.5s ease-out;
}

@keyframes userMessageGlow {
    0% { box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5); }
    100% { box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3); }
}

.assistant-message .message-content {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.assistant-message .message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: messageShimmer 2s ease-in-out infinite;
}

@keyframes messageShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Typing Cursor mit Neon-Effekt */
.typing-cursor {
    color: #667eea;
    font-weight: bold;
    animation: typingBlink 1s infinite, typingGlow 2s ease-in-out infinite alternate;
    margin-left: 3px;
    text-shadow: 0 0 10px currentColor;
}

@keyframes typingBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes typingGlow {
    0% { text-shadow: 0 0 10px currentColor; }
    100% { text-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

/* Enhanced Input Area */
.input-container {
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.input-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    position: relative;
}

.input-wrapper::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 15px;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(240, 147, 251, 0.1));
    z-index: -1;
    animation: inputGlow 3s ease-in-out infinite alternate;
}

@keyframes inputGlow {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

#userInput {
    flex: 1;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-size: 16px;
    resize: none;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: inherit;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#userInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#userInput:focus {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

#userInput:disabled {
    background-color: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
}

.send-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    position: relative;
    overflow: hidden;
}

.send-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;
}

.send-button:hover:not(:disabled)::before {
    left: 100%;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.send-button:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.input-info {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
}

/* Enhanced Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 25px;
    color: #667eea;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots div {
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    animation: loadingBounce 1.4s ease-in-out infinite both;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.loading-dots div:nth-child(1) { animation-delay: -0.32s; }
.loading-dots div:nth-child(2) { animation-delay: -0.16s; }
.loading-dots div:nth-child(3) { animation-delay: 0s; }

@keyframes loadingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.3);
    }
    40% {
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    }
}

/* Custom Scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6), rgba(118, 75, 162, 0.6));
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
}

/* Status Indicators */
.status-indicator {
    position: absolute;
    top: 20px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    z-index: 10;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    50% { opacity: 0.7; box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        height: calc(100vh - 20px);
        border-radius: 20px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .naia-avatar {
        width: 80px; /* Slightly larger for smaller screens */
        height: 80px; /* Slightly larger for smaller screens */
        top: 10px; /* Adjusted for smaller screens */
        right: 20px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 15px 20px;
    }
    
    .chat-messages {
        padding: 20px;
    }
    
    .input-container {
        padding: 20px;
    }
}

/* Special Effects */
.message.user-message .message-content {
    animation: messageSlideIn 0.5s ease-out, userMessageGlow 0.5s ease-out;
}

.assistant-message.typing .message-content {
    position: relative;
}

.assistant-message.typing .message-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: typingProgress 2s ease-in-out infinite;
}

@keyframes typingProgress {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.reset-button {
    background: linear-gradient(135deg, #f093fb, #764ba2);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    position: relative;
    overflow: hidden;
}

.reset-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;
}

.reset-button:hover:not(:disabled)::before {
    left: 100%;
}

.reset-button:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(240, 147, 251, 0.4);
}

.reset-button:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Ensure status indicator is properly positioned */
.status-indicator {
    position: absolute;
    top: 20px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    50% { opacity: 0.7; box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
}

/* Footer styles */
.footer {
    padding: 15px 30px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.footer p {
    margin: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer p:hover {
    opacity: 1;
}

/* Adjust container to accommodate footer */
.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ensure chat-container takes remaining space */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .status-indicator {
        top: 15px;
        left: 15px;
        font-size: 10px;
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    .footer {
        padding: 10px 20px;
        font-size: 10px;
    }
}

.back-button {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    background-color: #4B5563; /* bg-gray-700 */
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.back-button:hover {
    background-color: #6B7280; /* hover:bg-gray-600 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.back-button i {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.back-button span {
    font-size: 1rem;
}

/* Responsivität */
@media (max-width: 640px) {
    .back-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    .back-button i {
        font-size: 0.875rem;
    }
}

/* Alert-Modal */
.naia-alert-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.naia-alert-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalPop 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.naia-alert-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: messageShimmer 2s ease-in-out infinite;
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.naia-alert-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.6);
}

.naia-alert-content p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.naia-alert-close {
    background: linear-gradient(135deg, #f093fb, #764ba2);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.naia-alert-close::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;
}

.naia-alert-close:hover::before {
    left: 100%;
}

.naia-alert-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.4);
}

/* Vorschläge */
.suggestions-container {
    padding: 10px 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center; /* Zentrierung horizontal */
    background: transparent; /* Kein Hintergrund */
    position: relative;
}

.suggestion-item {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.5), rgba(118, 75, 162, 0.5));
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none; /* Keine Border */
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3), 0 0 30px rgba(0, 0, 0, 0.2);
    animation: floatSuggestion 4s ease-in-out infinite;
    backdrop-filter: blur(5px);
    text-align: center; /* Text innerhalb der Vorschläge zentriert */
}

.suggestion-item:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.5);
}

.suggestion-item:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

@keyframes floatSuggestion {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Responsive Anpassungen für Vorschläge */
@media (max-width: 768px) {
    .suggestions-container {
        padding: 10px 20px;
        flex-direction: column;
        align-items: center; /* Vertikale Zentrierung */
        justify-content: center; /* Horizontale Zentrierung */
    }
    
    .suggestion-item {
        width: 90%; /* Etwas schmaler für Mobilgeräte */
        max-width: 300px; /* Begrenze die Breite für längere Vorschläge */
    }
}