/* Oberwiesenthal Chat Widget - Design wie früher */

* {
    box-sizing: border-box;
}

.othal247-widget-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== HEADER SECTION ========== */
.othal247-header-section {
    text-align: center;
    padding: 60px 40px 40px;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e5e5;
}

.othal247-main-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

.othal247-subtitle {
    font-size: 16px;
    color: #666;
    margin: 10px 0;
    line-height: 1.6;
    font-weight: 400;
}

.othal247-description {
    font-size: 14px;
    color: #999;
    margin: 10px 0 0 0;
}

/* ========== CHAT HISTORY ========== */
.othal247-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fafafa;
    min-height: 0; /* Important für flex */
    transition: all 0.3s ease;
}

.othal247-message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    margin-bottom: 16px;
}

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

.othal247-message.user {
    justify-content: flex-end;
}

.othal247-message.assistant {
    justify-content: flex-start;
}

.othal247-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 15px;
}

.othal247-message.user .othal247-message-bubble {
    background: #007AFF;
    color: white;
    border-bottom-right-radius: 4px;
}

.othal247-message.assistant .othal247-message-bubble {
    background: #e5e5ea;
    color: #000;
    border-bottom-left-radius: 4px;
}

.othal247-message-bubble a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.othal247-message.user .othal247-message-bubble a {
    color: rgba(255, 255, 255, 0.9);
}

/* ========== SEARCH BOX ========== */
.othal247-search-box {
    padding: 30px 40px 40px;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
}

.othal247-input-wrapper {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.othal247-search-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    border: 1px solid #e5e5e5;
    border-radius: 24px;
    font-family: inherit;
    transition: all 0.2s;
    background: #f5f5f5;
    color: #1a1a1a;
}

.othal247-search-input:focus {
    outline: none;
    background: white;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.othal247-search-input::placeholder {
    color: #999;
}

.othal247-search-btn {
    width: 48px;
    height: 48px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.othal247-search-btn:hover {
    background: #0051D5;
    transform: scale(1.05);
}

.othal247-search-btn:active {
    transform: scale(0.95);
}

.othal247-search-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.othal247-icon {
    display: inline-block;
}

/* ========== LOADING STATE ========== */
.othal247-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.othal247-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007AFF;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== FOOTER ========== */
.othal247-footer-text {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin: 0;
    padding: 0 40px 20px;
    line-height: 1.4;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    .othal247-widget-container {
        min-height: auto;
        margin: 0;
        padding: 0;
    }
    
    .othal247-header-section {
        padding: 40px 20px 30px;
    }
    
    .othal247-main-title {
        font-size: 36px;
        margin-bottom: 15px;
    }
    
    .othal247-subtitle {
        font-size: 15px;
    }
    
    .othal247-chat-history {
        padding: 20px;
    }
    
    .othal247-message-bubble {
        max-width: 85%;
    }
    
    .othal247-search-box {
        padding: 20px;
    }
    
    .othal247-input-wrapper {
        max-width: 100%;
    }
    
    .othal247-search-input {
        font-size: 16px;
    }
    
    .othal247-search-btn {
        width: 44px;
        height: 44px;
    }
    
    .othal247-footer-text {
        padding: 0 20px 15px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .othal247-main-title {
        font-size: 28px;
    }
    
    .othal247-subtitle {
        font-size: 14px;
    }
    
    .othal247-message-bubble {
        max-width: 90%;
        padding: 10px 14px;
        font-size: 14px;
    }
}

/* ========== ADMIN DASHBOARD ========== */
.othal-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.othal-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.othal-card h3 {
    margin-top: 0;
    color: #007AFF;
    border-bottom: 2px solid #007AFF;
    padding-bottom: 10px;
}

.othal-toolbar {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    margin: 12px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.othal-table {
    width: 100%;
    border-collapse: collapse;
}

.othal-table td, .othal-table th {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.othal-table tbody tr:hover {
    background: #f5f5f5;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-approved {
    background: #d4edda;
    color: #155724;
}

.badge-locked {
    background: #f8d7da;
    color: #721c24;
}

.badge-src {
    background: #d1ecf1;
    color: #0c5460;
}
