/* DomAssist Widget Styles - Extended Version */

:root {
    --domassist-primary: #14b8a6;
    --domassist-primary-dark: #0d9488;
    --domassist-bg: #ffffff;
    --domassist-text: #1a1a1a;
    --domassist-border: rgba(0, 0, 0, 0.08);
    --domassist-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Widget Container */
#domassist-widget-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Button */
#domassist-chat-button {
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background: linear-gradient(135deg, var(--domassist-primary) 0%, var(--domassist-primary-dark) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: var(--domassist-shadow);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

#domassist-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(20, 184, 166, 0.4);
}

/* Notification Badge */
.domassist-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
#domassist-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: var(--domassist-bg);
    border-radius: 20px;
    box-shadow: var(--domassist-shadow);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid var(--domassist-border);
}

#domassist-chat-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Loading Overlay */
.domassist-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.domassist-loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.domassist-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--domassist-border);
    border-top-color: var(--domassist-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Header */
#domassist-chat-header {
    background: linear-gradient(135deg, var(--domassist-primary) 0%, var(--domassist-primary-dark) 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    border-radius: 20px 20px 0 0;
}

.domassist-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.domassist-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.domassist-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.domassist-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.domassist-status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#domassist-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
    padding: 0;
    width: 30px;
    height: 30px;
}

#domassist-close-button:hover {
    opacity: 1;
}

/* Mode Toggle */
.domassist-mode-toggle {
    display: flex;
    padding: 12px;
    gap: 8px;
    background: #f9fafb;
    border-bottom: 1px solid var(--domassist-border);
}

.domassist-mode-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--domassist-border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.domassist-mode-btn.active {
    background: var(--domassist-primary);
    color: white;
    border-color: var(--domassist-primary);
}

/* Messages Container */
#domassist-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
}

/* Welcome Message */
.domassist-welcome {
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.5s ease;
}

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

.domassist-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.domassist-welcome h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--domassist-text);
}

.domassist-welcome p {
    color: #666;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Quick Actions */
.domassist-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.domassist-quick-action {
    background: white;
    border: 1px solid var(--domassist-border);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--domassist-text);
}

.domassist-quick-action:hover {
    background: var(--domassist-primary);
    color: white;
    border-color: var(--domassist-primary);
}

/* Messages */
.domassist-message {
    display: flex;
    margin-bottom: 16px;
    animation: slideIn 0.3s ease;
}

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

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

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

.domassist-message.bot .domassist-message-content {
    background: white;
    color: var(--domassist-text);
    border: 1px solid var(--domassist-border);
    border-radius: 16px 16px 16px 4px;
}

.domassist-message.user .domassist-message-content {
    background: linear-gradient(135deg, var(--domassist-primary) 0%, var(--domassist-primary-dark) 100%);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

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

.domassist-typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.domassist-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.domassist-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
#domassist-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid var(--domassist-border);
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#domassist-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--domassist-border);
    border-radius: 20px;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 120px;
    transition: border-color 0.3s ease;
}

#domassist-input:focus {
    border-color: var(--domassist-primary);
}

#domassist-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--domassist-primary) 0%, var(--domassist-primary-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#domassist-send-button:hover {
    transform: scale(1.1);
}

/* Voice Record Button */
.domassist-voice-record {
    display: none;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--domassist-primary) 0%, var(--domassist-primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.domassist-voice-record.show {
    display: flex;
}

.domassist-voice-record.recording {
    background: #ef4444;
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.domassist-voice-waveform {
    display: flex;
    gap: 3px;
    align-items: center;
}

.domassist-voice-bar {
    width: 3px;
    height: 20px;
    background: white;
    animation: wave 1s infinite;
}

.domassist-voice-bar:nth-child(2) { animation-delay: 0.1s; height: 15px; }
.domassist-voice-bar:nth-child(3) { animation-delay: 0.2s; }
.domassist-voice-bar:nth-child(4) { animation-delay: 0.3s; height: 25px; }
.domassist-voice-bar:nth-child(5) { animation-delay: 0.4s; height: 18px; }

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

/* DSGVO Popup */
#domassist-dsgvo-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

#domassist-dsgvo-popup.show {
    display: flex;
}

.domassist-dsgvo-content {
    background: white;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.domassist-dsgvo-header {
    text-align: center;
    margin-bottom: 24px;
}

.domassist-dsgvo-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.domassist-dsgvo-header h3 {
    font-size: 22px;
    margin: 0;
    color: var(--domassist-text);
}

.domassist-dsgvo-body {
    margin-bottom: 24px;
}

.domassist-dsgvo-body p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.domassist-dsgvo-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.domassist-dsgvo-list li {
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.domassist-dsgvo-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--domassist-primary);
    font-weight: bold;
}

.domassist-dsgvo-checkbox {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
}

.domassist-dsgvo-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    color: #666;
}

.domassist-dsgvo-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--domassist-primary);
    margin-top: 2px;
}

.domassist-dsgvo-checkbox a {
    color: var(--domassist-primary);
    text-decoration: underline;
}

.domassist-dsgvo-buttons {
    display: flex;
    gap: 12px;
}

.domassist-dsgvo-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.domassist-dsgvo-btn-decline {
    background: #f3f4f6;
    color: #666;
}

.domassist-dsgvo-btn-accept {
    background: linear-gradient(135deg, var(--domassist-primary) 0%, var(--domassist-primary-dark) 100%);
    color: white;
}

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

.domassist-dsgvo-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Toast Notifications */
.domassist-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    z-index: 10001;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.domassist-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.domassist-toast.success {
    border-left: 4px solid #10b981;
}

.domassist-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.domassist-toast-icon {
    font-size: 20px;
}

.domassist-toast-message {
    font-size: 14px;
    color: var(--domassist-text);
}

.domassist-toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
}

/* Powered By */
.domassist-powered {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: #999;
    border-top: 1px solid var(--domassist-border);
    background: #f9fafb;
}

.domassist-powered a {
    color: var(--domassist-primary);
    text-decoration: none;
    font-weight: 600;
}

.domassist-powered a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #domassist-chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        position: fixed;
    }
    
    #domassist-chat-window.open {
        bottom: 0;
    }
    
    #domassist-chat-button {
        bottom: 20px;
        right: 20px;
    }
    
    .domassist-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Audio Player */
.domassist-audio-player {
    width: 100%;
}

.domassist-audio-player audio {
    width: 100%;
    height: 40px;
}

/* Links in Messages */
.domassist-message-content a {
    color: var(--domassist-primary);
    text-decoration: underline;
}

.domassist-message.user .domassist-message-content a {
    color: white;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus Styles */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--domassist-primary);
    outline-offset: 2px;
}

/* Scrollbar Styling */
#domassist-messages::-webkit-scrollbar {
    width: 6px;
}

#domassist-messages::-webkit-scrollbar-track {
    background: transparent;
}

#domassist-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

#domassist-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}
