/**
 * Support-Request Styles v6.2
 * ✅ Mit Loading-Indicator, Confirmation-Dialog und UX-Improvements
 */

/* === GLOBAL === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333333;
    line-height: 1.6;
}

/* === CONTAINER === */
.support-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px;
}

/* === HEADER === */
.support-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 5px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.logo-placeholder {
    width: 150px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    margin-right:3.5rem;
    margin-left:2rem;
}

.support-title h1 {
    font-size: 28px;
    font-weight: 600;
    color: #003479;
    margin-bottom: 5px;
}

.support-title p {
    color: #666;
    font-size: 16px;
}

/* === MAIN LAYOUT === */
.support-main {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 5px;
}

@media (max-width: 1024px) {
    .support-main {
        grid-template-columns: 1fr;
    }
}

/* === SIDEBAR === */
.support-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-contact {
    width: 100%;
    padding: 16px 20px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    line-height: 1.4;
    white-space: normal;
    background: linear-gradient(135deg, #003479 0%, #0055aa 100%);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 52, 121, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 52, 121, 0.4);
}

.btn-contact:active {
    transform: translateY(0);
}

/* === SESSION INFO === */
.session-info {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.session-info-header {
    font-size: 18px;
    font-weight: 600;
    color: #003479;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.session-info-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.session-info-item:last-child {
    border-bottom: none;
}

.session-info-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.session-info-value {
    color: #333;
    font-size: 14px;
}

/* === FILE UPLOAD === */
.file-upload-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.file-upload-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #003479;
    margin-bottom: 15px;
}

.file-upload-box {
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-box:hover,
.file-label.drag-over .file-upload-box {
    border-color: #003479;
    background-color: #f8f9ff;
}

.file-upload-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.file-upload-box p {
    font-size: 15px;
    color: #333;
    margin-bottom: 5px;
}

.file-upload-box small {
    font-size: 13px;
    color: #666;
}

.uploaded-files-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-icon {
    font-size: 24px;
}

.file-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.file-size {
    font-size: 12px;
    color: #666;
}

.file-remove {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.file-remove:hover {
    background: #c82333;
}

/* === CHAT AREA === */
.support-chat {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

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

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

.message-system {
    align-self: center;
    max-width: 90%;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}
.message-user .message-bubble {
    background: #003479;
    color: white;
    border-bottom-right-radius: 4px;
    font-weight: bold;
}


.message-assistant .message-bubble {
    background: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-system .message-bubble {
    background: #fff3cd;
    color: #856404;
    text-align: center;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

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

/* ✅ v6.2: LOADING INDICATOR */
.loading-message {
    background: #f0f0f0 !important;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.3s ease-in;
}

.loading-dots {
    display: flex;
    gap: 6px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #666;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

.loading-text {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

/* ✅ v6.2: SYSTEM MESSAGE STYLING */
.system-message {
    background: linear-gradient(135deg, #FFB74D 0%, #FFA726 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: 500;
    text-align: center;
}

/* === CHAT INPUT === */
.chat-input-wrapper {
    border-top: 1px solid #e9ecef;
    padding: 20px;
}

.btn-export {
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.2s;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.btn-export:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ✅ v6.2: EXPORT-BUTTON ACTIVE STATE */
#exportButton:not(:disabled) {
    cursor: pointer;
    transition: all 0.2s ease;
}

#exportButton:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: #003479;
}

.chat-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.btn-send {
    padding: 12px 24px;
    background: #003479;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #00509e;
}

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

.send-icon {
    font-size: 18px;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #003479 0%, #0055aa 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 30px;
}

.modal-intro {
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
    line-height: 1.6;
}

/* ✅ v6.2: CONTACT CHANGE DIALOG */
#contactChangeDialog .modal-content {
    animation: slideUp 0.3s ease-out;
}

#contactChangeDialog .current-data {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #003479;
}

#contactChangeDialog .current-data p {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.5;
}

#contactChangeDialog .current-data strong {
    color: #003479;
    font-weight: 600;
}

/* === FORM === */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.required {
    color: #dc3545;
}

.optional {
    font-weight: 400;
    color: #999;
    font-size: 13px;
}

.form-input {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #003479;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* === CONSENT BOX === */
.form-consent {
    margin-top: 10px;
}

.consent-box {
    background: #e7f3ff;
    border: 2px solid #0066cc;
    border-radius: 10px;
    padding: 20px;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 15px;
}

.consent-label input[type="checkbox"] {
    margin-top: 4px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.consent-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.consent-understand {
    padding: 10px 20px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.consent-understand:hover {
    background: #0052a3;
}

/* === BUTTONS === */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #003479;
    color: white;
}

.btn-primary:hover {
    background: #00509e;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #4CAF50;
    color: white;
    width:40%;
}

.btn-success:hover {
    background: #45a049;
}

.btn-save {
    width: 100%;
    padding: 16px;
    font-size: 16px;
}

/* ✅ v6.2: VERBESSERTE BUTTON STATES */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary:disabled {
    background: #999 !important;
}

.btn-secondary:disabled {
    background: #ccc !important;
}

/* === ALERTS === */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
    animation: alertSlideDown 0.3s ease-out;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ✅ v6.2: GLOBAL ALERT IMPROVEMENTS */
.global-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    max-width: 400px;
}

.global-alert.show {
    opacity: 1;
    transform: translateX(0);
}

.global-alert.success {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.global-alert.error {
    background: linear-gradient(135deg, #f44336 0%, #e53935 100%);
    color: white;
}

.global-alert.info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

/* === UTILITIES === */
.text-muted {
    color: #6c757d;
}

.text-sm {
    font-size: 13px;
}

/* ✅ v6.2: IMPROVED FOCUS STATES */
input:focus,
textarea:focus {
    outline: none;
    border-color: #003479;
    box-shadow: 0 0 0 3px rgba(0, 52, 121, 0.1);
}

/* === ANIMATIONS === */
@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .support-container {
        padding: 10px;
    }
    
    .support-header {
        flex-direction: column;
        text-align: center;
    }
    
    .support-main {
        grid-template-columns: 1fr;
    }
    
    .support-chat {
        height: calc(100vh - 300px);
    }
    
    .chat-message {
        max-width: 85%;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    /* ✅ v6.2: MOBILE OPTIMIZATIONS */
    .loading-message {
        padding: 12px 15px;
    }
    
    .loading-dots span {
        width: 6px;
        height: 6px;
    }
    
    .loading-text {
        font-size: 13px;
    }
    
    .global-alert {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 14px;
        padding: 12px 20px;
    }
    
    #contactChangeDialog .modal-content {
        margin: 20px;
        max-width: none !important;
    }
}

/* ✅ v6.2.4: User-Messages BOLD (echte Klassen!) */
.message.user .message-content {
    font-weight: bold;
    color: white;
    background: #003479;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: #f0f0f0;
    color: #333;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}
