/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    color: #ffffff;
    overflow: hidden;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: #0a0a0a;
    position: relative;
}

/* Header */
.chat-header {
    background: #111111;
    border-bottom: 1px solid #1a1a1a;
    padding: 1rem 2rem;
    position: relative;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.header-info h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-info p {
    font-size: 0.85rem;
    color: #888888;
    font-weight: 400;
}

.status-indicator {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #888888;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #00ff88;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 70%;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message {
    align-self: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: white;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-text {
    padding: 1rem 1.25rem;
    border-radius: 16px;
    line-height: 1.6;
    word-wrap: break-word;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-message .message-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.ai-message .message-text {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.message-time {
    font-size: 0.7rem;
    color: #888888;
    margin-top: 0.5rem;
    text-align: right;
    font-weight: 400;
}

.user-message .message-time {
    text-align: left;
}

/* Input Container */
.chat-input-container {
    padding: 1rem 2rem;
    background: #111111;
    border-top: 1px solid #1a1a1a;
    position: relative;
}

.chat-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00d4ff, transparent);
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.75rem 1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    max-width: 1400px;
    margin: 0 auto;
}

.input-wrapper:focus-within {
    border-color: #00d4ff;
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2), 0 8px 32px rgba(0, 212, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    max-height: 120px;
    min-height: 24px;
    color: #ffffff;
}

#messageInput::placeholder {
    color: #666666;
}

.send-button {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.send-button:hover:not(:disabled) {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.4);
}

.send-button:active:not(:disabled) {
    transform: scale(0.95) translateY(0);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.send-button:disabled {
    background: #333333;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.5;
}




/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
    }
    
    .chat-header {
        padding: 1rem 1.5rem;
    }
    
    .header-content {
        gap: 0.75rem;
    }
    
    .ai-avatar {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .header-info h1 {
        font-size: 1.2rem;
    }
    
    .header-info p {
        font-size: 0.8rem;
    }
    
    .chat-messages {
        padding: 1.5rem 1rem;
        gap: 1.25rem;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .message-text {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .chat-input-container {
        padding: 1rem 1.5rem;
    }
    
    .input-wrapper {
        padding: 0.75rem 1rem;
    }
    
    .send-button {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 0.875rem 1rem;
    }
    
    .header-info h1 {
        font-size: 1.1rem;
    }
    
    .chat-messages {
        padding: 1rem 0.75rem;
    }
    
    .chat-input-container {
        padding: 0.875rem 1rem;
    }
    
    .input-wrapper {
        padding: 0.75rem 1rem;
    }
    
    .message-text {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .message {
        max-width: 90%;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    border-bottom-left-radius: 6px;
    max-width: 80px;
    backdrop-filter: blur(10px);
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #00d4ff;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

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

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