/* =========================
   KI-Assistent Styles
   Modulare Version - Getrennt von HTML
   ========================= */

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #656565 0%, #797979 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

/* Main Container */
.chat-container {
    max-width: 1024px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(90deg, #D47B1B, #DF9240);
    color: white;
    padding: 20px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 24px;
}

/* User Selection */
.user-selection {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.user-type-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.user-type-label {
    font-weight: 500;
    color: #495057;
    margin-right: 10px;
}

.user-type-option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-type-option input[type="radio"] {
    margin: 0;
}

.user-type-option label {
    font-size: 14px;
    color: #6c757d;
    cursor: pointer;
    margin: 0;
}

/* Session Info Display */
.session-info {
    padding: 8px 20px;
    background: #e8f4fd;
    border-bottom: 1px solid #bee5eb;
    font-size: 12px;
    color: #0c5460;
}

.session-controls {
    float: right;
}

.session-controls button {
    background: none;
    border: 1px solid #17a2b8;
    color: #17a2b8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 5px;
}

.session-controls button:hover {
    background: #17a2b8;
    color: white;
}

/* Export Button Special Styling */
.session-controls .export-session-btn {
    background: #28a745;
    border: 1px solid #28a745;
    color: white;
}

.session-controls .export-session-btn:hover {
    background: #218838;
    border-color: #1e7e34;
}

.session-controls .export-session-btn:disabled {
    background: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

/* Input Section */
.input-section {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.message-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.message-input:focus {
    border-color: #4A90E2;
}

.send-btn {
    padding: 12px 20px;
    background: #4A90E2;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.send-btn:hover:not(:disabled) {
    background: #357ABD;
}

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

/* Chat Area */
.chat-area {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

/* Messages */
.message {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    max-width: 95%;
}

.message.user {
    background: #4A90E2;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message.bot {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}

.message-label {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.message-meta {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 5px;
}

/* Bot Message Formatting */
.message.bot h3 {
    color: #4A90E2;
    margin: 10px 0 5px 0;
    font-size: 16px;
}

.message.bot h4 {
    color: #357ABD;
    margin: 8px 0 4px 0;
    font-size: 14px;
}

.message.bot ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message.bot li {
    margin-bottom: 4px;
}

/* Loading Indicator */
.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6c757d;
    font-style: italic;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #4A90E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.error {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-color: #f5c6cb !important;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin: 20px 0;
}

/* Config Loading */
.config-loading {
    color: #6c757d;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

/* Export Dialog Styles */
.export-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.export-dialog-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.export-dialog h3 {
    margin: 0 0 20px 0;
    color: #4A90E2;
    font-size: 20px;
}

/* Export Form Elements */
.export-form-group {
    margin-bottom: 20px;
}

.export-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.export-select, 
.export-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.export-select:focus, 
.export-textarea:focus {
    outline: none;
    border-color: #4A90E2;
}

.export-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* Export Info Box */
.export-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    font-size: 13px;
    color: #6c757d;
    margin: 15px 0;
}

/* Export Status Box */
.export-status {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    margin: 15px 0;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.export-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.export-btn-primary {
    background: #4A90E2;
    color: white;
}

.export-btn-primary:hover:not(:disabled) {
    background: #357ABD;
}

.export-btn-secondary {
    background: #6c757d;
    color: white;
}

.export-btn-secondary:hover {
    background: #545b62;
}

.export-btn:disabled {
    background: #ced4da;
    color: #6c757d;
    cursor: not-allowed;
}

/* Export Messages */
.export-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
}

.export-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .input-row {
        flex-direction: column;
    }

    .message {
        max-width: 95%;
    }

    .user-type-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .session-controls {
        float: none;
        margin-top: 5px;
    }

    .export-dialog-content {
        padding: 20px;
        margin: 10px;
    }

    .export-buttons {
        flex-direction: column;
    }
}