/* Rikkes AI Chat Widget Styles */

#rikkes-ai-chat-widget {
    position: fixed;
    bottom: 80px;
    right: 10px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Chat Bubble */
#rikkes-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bubble-color, #FF6B6B);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: white;
}

#rikkes-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#rikkes-chat-bubble.hidden {
    display: none;
}

/* Chat Window */
#rikkes-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.rikkes-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.rikkes-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rikkes-chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rikkes-chat-title h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.rikkes-chat-status {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rikkes-chat-status::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#rikkes-chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
    flex-shrink: 0;
}

#rikkes-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Messages Area */
.rikkes-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 14px;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.rikkes-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.rikkes-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.rikkes-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

/* Message Bubbles */
.rikkes-message {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rikkes-message.user {
    flex-direction: row-reverse;
}

.rikkes-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.rikkes-message.bot .rikkes-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.rikkes-message.user .rikkes-message-avatar {
    background: #e2e8f0;
}

.rikkes-message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.rikkes-message.bot .rikkes-message-bubble {
    background: white;
    color: #1a202c;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.rikkes-message.user .rikkes-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.rikkes-typing {
    display: flex;
    gap: 3px;
    padding: 6px 10px;
}

.rikkes-typing span {
    width: 7px;
    height: 7px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.rikkes-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.rikkes-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* Input Area */
.rikkes-chat-input-wrapper {
    padding: 12px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

#rikkes-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    background: white;
}

#rikkes-chat-input:focus {
    border-color: #667eea;
}

#rikkes-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

#rikkes-chat-send:hover {
    transform: scale(1.05);
}

#rikkes-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsive - KRITISK */
/* Rikkes AI Chat Widget Styles */

@media (max-width: 768px) {

    #rikkes-chat-window {
        position: fixed !important;
        inset: 0 !important;

        width: 100% !important;

        height: 100dvh !important;
        max-height: 100dvh !important;

        border-radius: 0 !important;
    }

}

/* Chat Bubble */
#rikkes-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bubble-color, #FF6B6B);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    color: white;
}

#rikkes-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#rikkes-chat-bubble.hidden {
    display: none;
}

/* Chat Window */
#rikkes-chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.rikkes-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.rikkes-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rikkes-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rikkes-chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.rikkes-chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rikkes-chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#rikkes-chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

#rikkes-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Messages Area */
.rikkes-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
}

.rikkes-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.rikkes-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.rikkes-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

/* Message Bubbles */
.rikkes-message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rikkes-message.user {
    flex-direction: row-reverse;
}

.rikkes-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.rikkes-message.bot .rikkes-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.rikkes-message.user .rikkes-message-avatar {
    background: #e2e8f0;
}

.rikkes-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.rikkes-message.bot .rikkes-message-bubble {
    background: white;
    color: #1a202c;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rikkes-message.user .rikkes-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.rikkes-typing {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.rikkes-typing span {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.rikkes-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.rikkes-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Input Area */
.rikkes-chat-input-wrapper {
    padding: 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

#rikkes-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

#rikkes-chat-input:focus {
    border-color: #667eea;
}

#rikkes-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

#rikkes-chat-send:hover {
    transform: scale(1.05);
}

#rikkes-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsive - Fuld skærm + keyboard-fix */
/* Mobile Responsive - INGEN AUTO-FOCUS */
@media (max-width: 768px) {
    #rikkes-chat-window {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        border-radius: 16px 16px 0 0 !important;
        position: fixed !important;
    }
    
    #rikkes-ai-chat-widget {
        bottom: 100px !important;
        right: 15px !important;
    }
    
    #rikkes-chat-bubble {
        width: 56px;
        height: 56px;
    }
}

/* Tablet Support */
@media (min-width: 769px) and (max-width: 1024px) {
    #rikkes-chat-window {
        width: 420px !important;
        height: 70vh !important;
        max-height: 700px !important;
    }
}
