/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #1e293b;
}

.hidden {
    display: none !important;
}

/* App container - fullscreen layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: #1e293b;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Persona Toggle */
.persona-toggle {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.toggle-avatars {
    display: flex;
}

.toggle-avatars .avatar-mini:last-child {
    margin-left: -6px;
}

.avatar-mini {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 10px;
    color: white;
}

.avatar-mini.avatar-kai {
    background: #3b82f6;
}

.avatar-mini.avatar-lena {
    background: #ec4899;
    border: 2px solid #1e293b;
}

.avatar-mini.avatar-harald {
    background: #d97706;
}

.toggle-name {
    white-space: nowrap;
}

/* Persona Info Container */
.persona-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.persona-card {
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.avatar-group {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.avatar-group .avatar:last-child {
    margin-left: -12px;
    border: 3px solid #1e293b;
}

.avatar-kai {
    background: #3b82f6;
    color: white;
}

.avatar-lena {
    background: #ec4899;
    color: white;
}

.avatar-harald, .avatar-harald-large {
    background: #d97706;
    color: white;
}

.avatar-harald-large {
    width: 64px;
    height: 64px;
    font-size: 24px;
    margin: 0 auto 12px;
}

.persona-card h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #ffffff;
}

.persona-subtitle {
    font-size: 13px;
    color: #94a3b8;
}

/* Persona details */
.persona-details {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 24px;
}

.detail-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 12px;
    font-weight: 600;
}

.detail-section ul {
    list-style: none;
}

.detail-section li {
    font-size: 13px;
    padding: 6px 0;
    color: #cbd5e1;
    line-height: 1.4;
}

.detail-section li strong {
    color: #e2e8f0;
}

/* Reset button */
.reset-btn {
    margin: 16px 20px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-footer p {
    font-size: 11px;
    color: #64748b;
    text-align: center;
}

/* Main chat area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    background: #f8fafc;
}

/* Chat messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* Welcome message */
.welcome-message {
    max-width: 550px;
    margin: 60px auto;
    text-align: center;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.welcome-icon {
    margin-bottom: 20px;
    color: #4f46e5;
}

.welcome-icon.harald {
    color: #d97706;
}

.welcome-message h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.welcome-message > p {
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 32px;
}

.example-questions {
    text-align: left;
}

.example-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 600;
}

.example-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
}

.example-btn:hover {
    border-color: #4f46e5;
    background: #f8fafc;
}

/* Harald theme for example buttons */
[data-persona="harald"] .example-btn:hover {
    border-color: #d97706;
    background: #fffbeb;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 700px;
    margin-bottom: 20px;
}

.message-user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.message-bot {
    margin-right: auto;
}

.message-avatar {
    flex-shrink: 0;
}

.message-avatar .avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.message-avatar .avatar-group {
    display: flex;
}

.message-avatar .avatar-group .avatar:last-child {
    margin-left: -10px;
    border: 2px solid #f8fafc;
}

.message-content {
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.message-user .message-content {
    background: #4f46e5;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* Harald theme for user messages */
[data-persona="harald"] .message-user .message-content {
    background: #d97706;
}

.message-bot .message-content {
    background: #ffffff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

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

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

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

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
    }
    40% {
        transform: scale(1);
    }
}

/* Input area */
.chat-input-container {
    padding: 20px 32px 32px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.chat-form {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 12px 12px 20px;
}

.input-wrapper:focus-within {
    border-color: #4f46e5;
}

[data-persona="harald"] .input-wrapper:focus-within {
    border-color: #d97706;
}

.input-wrapper textarea {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    color: #1e293b;
    min-height: 24px;
    max-height: 150px;
    padding: 0;
}

.input-wrapper textarea:focus {
    outline: none;
}

.input-wrapper textarea::placeholder {
    color: #94a3b8;
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #4f46e5;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 8px;
}

.send-btn:hover:not(:disabled) {
    background: #4338ca;
}

[data-persona="harald"] .send-btn {
    background: #d97706;
}

[data-persona="harald"] .send-btn:hover:not(:disabled) {
    background: #b45309;
}

.send-btn:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
}

/* Error message */
.error-message {
    max-width: 600px;
    margin: 20px auto;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
}

/* Scrollbar */
.chat-messages::-webkit-scrollbar,
.persona-details::-webkit-scrollbar {
    width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.persona-details::-webkit-scrollbar-track {
    background: transparent;
}

.persona-details::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        flex-direction: column;
        padding: 0;
    }

    .persona-toggle {
        padding: 12px;
    }

    .toggle-btn {
        padding: 8px 10px;
    }

    .persona-info {
        display: none;
    }

    .reset-btn {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .chat-main {
        height: calc(100vh - 60px);
    }

    .chat-messages {
        padding: 20px;
    }

    .chat-input-container {
        padding: 16px 20px 24px;
    }

    .welcome-message {
        margin: 20px auto;
        padding: 24px;
    }
}
