


/* ========================================================================= */
/*  2. CHAT KNAPPER (Desktop & Mobil)
    Definerer de to forskellige chatknapper. De er som standard skjulte,
    og deres synlighed styres via media queries.
/* ========================================================================= */

/* Desktop Chat Button (oprindeligt .chat-button fra chatcomp.css) */
.chat-button-desktop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #d86f30 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 
        0 8px 25px rgba(216, 111, 48, 0.3),
        0 0 0 1px rgba(216, 111, 48, 0.1);
    z-index: 1002;
    display: none; /* Skjult som standard, vises på desktop via media query */
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    text-decoration: none;
    min-width: 60px;
    justify-content: center;
    animation: chatPulse 2s ease-in-out infinite;
}

.chat-button-desktop:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 
        0 15px 35px rgba(216, 111, 48, 0.4),
        0 0 0 1px rgba(216, 111, 48, 0.2);
    background: linear-gradient(135deg, #c8642b 0%, #d9721e 100%);
}

.chat-button-desktop .chat-icon {
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-button-desktop .chat-text {
    font-size: 0.95rem;
    white-space: nowrap;
}

.chat-button-desktop.minimized .chat-text {
    display: none;
}

.chat-button-desktop.minimized {
    padding: 18px;
    min-width: auto;
}

/* Mobile Chat Button (oprindeligt .chat-button fra chat_mobile.css) */
.chat-button-mobile {
    position: fixed;
    right: 0;
    bottom: 100px; /* Standard placering, justeres i mobile media queries */
    background: #d86f30;
    color: #ffffff;
    border: none;
    border-radius: 6px 0 0 6px;
    padding: 2px 0;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 
        -3px 0 10px rgba(216, 111, 48, 0.3),
        0 0 0 1px rgba(216, 111, 48, 0.2);
    z-index: 1002;
    display: none; /* Skjult som standard, vises på mobil via media query */
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    width: 18px;
    height: 100px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    overflow: hidden;
    opacity: 0;
    transform: translateX(18px);
    animation: slideInFadeIn 0.5s ease-in 5s forwards; /* Specifik mobil animations-delay */
}

.chat-button-mobile:hover,
.chat-button-mobile:focus {
    background: #e67e22;
    color: #ffffff;
    transform: translateX(-2px);
    box-shadow: 
        -6px 0 15px rgba(216, 111, 48, 0.4),
        0 0 0 1px rgba(216, 111, 48, 0.3);
    width: 20px; /* Bliver bredere ved hover/focus */
}

.chat-button-mobile .chat-icon {
    display: none !important; /* Den mobile knap viser ikke et ikon */
}

.chat-button-mobile .chat-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    writing-mode: vertical-rl; /* Teksten er lodret */
    text-orientation: mixed;
    white-space: nowrap;
    transform: rotate(180deg); /* Roterer teksten til korrekt læseretning */
    line-height: 1;
    margin: 0;
    padding: 0;
    display: block;
    height: fit-content;
}

/* Fælles regel: Skjul den aktive chatknap når widgetten er åben */
/* Dette selektor virker nu, fordi vi bruger de nye knap klasser. */
.chat-widget.show ~ .chat-button-desktop,
.chat-widget.show ~ .chat-button-mobile {
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px) scale(0.8);
    pointer-events: none;
}


/* ========================================================================= */
/*  3. CHAT WIDGET (Chatvinduet)
    Kombinerede styles for chatvinduet. Prioriterer chatcomp.css for æstetik,
    men med mobil-specifikke tilføjelser fra chat_mobile.css.
/* ========================================================================= */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px; /* Standard højde (fra chatcomp.css), justeres i media queries */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 
        0 25px 60px rgba(216, 111, 48, 0.2),
        0 0 0 1px rgba(216, 111, 48, 0.1);
    z-index: 1001;
    display: none; /* Skjult som standard, JS viser den */
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.8);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(216, 111, 48, 0.15);
}

.chat-widget.show {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
    animation: chatSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #d86f30 0%, #e67e22 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    user-select: none; /* Fra chat_mobile.css */
}

.chat-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header .status-indicator {
    width: 8px;
    height: 8px;
    background: #ef4444; /* Rød som standard (lukket) */
    border-radius: 50%;
    animation: statusPulse 2s infinite;
    transition: background-color 0.3s ease;
}

.chat-header .status-indicator.online {
    background: #10b981; /* Grøn når åben */
}

.chat-header .status-indicator.offline {
    background: #ef4444; /* Rød når lukket */
}

.chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent; /* Fra chat_mobile.css */
    touch-action: manipulation; /* Fra chat_mobile.css */
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 0; /* Starter med 0 padding, justeres med * > * */
    overflow-y: auto;
    background: linear-gradient(145deg, 
        rgba(254, 249, 240, 0.8) 0%, 
        rgba(255, 255, 255, 0.9) 100%);
    scrollbar-width: thin;
    scrollbar-color: rgba(216, 111, 48, 0.3) transparent;
    position: relative;
    height: 100%;
    -webkit-overflow-scrolling: touch; /* Fra chat_mobile.css */
    overscroll-behavior: contain; /* Fra chat_mobile.css */
}

/* Indre padding for messages via direct children */
.chat-messages > * {
    margin: 15px; /* Fra chatcomp.css */
}

.chat-messages > *:first-child {
    margin-top: 15px;
}

.chat-messages > *:last-child {
    margin-bottom: 15px;
}


.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(216, 111, 48, 0.05);
    border-radius: 4px;
    margin: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(216, 111, 48, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(216, 111, 48, 0.5);
}

.chat-message {
    margin: 0 0 12px 0 !important; /* Fra chatcomp.css */
    display: flex;
    flex-direction: column;
    animation: messageSlideIn 0.3s ease-out;
}

.chat-message:last-child {
    margin-bottom: 0 !important; /* Fra chatcomp.css */
}

.chat-message.user {
    align-items: flex-end;
    margin-left: 10px;
}

.chat-message.admin {
    align-items: flex-start;
    background: transparent;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    /* word-wrap: break-word; /* Fra chatcomp.css - KOMMENTERET UD */
    /* overflow-wrap: break-word; /* Fra chat_mobile.css (bedre kompatibilitet) - KOMMENTERET UD */
    /* hyphens: auto; /* Fra chat_mobile.css - KOMMENTERET UD */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tilføjet for bedre link håndtering */
    white-space: normal; /* Ændret fra pre-wrap til normal */
    word-break: normal; /* Tilføjet */
    overflow-wrap: normal; /* Tilføjet */
}

/* Link styling i chat beskeder */
.message-bubble a,
.message-bubble a:visited {
    color: #d86f30 !important;
    text-decoration: none !important;
    font-weight: 500;
    white-space: nowrap;
    display: inline;
    word-break: keep-all;
    overflow-wrap: normal;
    text-decoration-skip-ink: none;
    text-underline-offset: 2px;
    margin: 0 2px;
    padding: 0 1px;
}

.message-bubble a:hover,
.message-bubble a:visited:hover {
    color: #c8642b !important;
    text-decoration: none !important;
    background-color: rgba(216, 111, 48, 0.1);
    border-radius: 3px;
    padding: 1px 2px;
}

.message-bubble a:focus,
.message-bubble a:visited:focus {
    outline: 2px solid rgba(216, 111, 48, 0.4);
    outline-offset: 1px;
    border-radius: 3px;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #d86f30 0%, #e67e22 100%);
    color: white;
    border-bottom-right-radius: 6px;
    position: relative;
    overflow: hidden;
}

/* Links i bruger beskeder skal være hvide */
.chat-message.user .message-bubble a,
.chat-message.user .message-bubble a:visited {
    color: white !important;
    text-decoration: none !important;
    font-weight: 600;
}

.chat-message.user .message-bubble a:hover,
.chat-message.user .message-bubble a:visited:hover {
    color: #f0f0f0 !important;
    text-decoration: none !important;
    background-color: rgba(255, 255, 255, 0.2);
}	

/* Links i bruger beskeder skal være hvide */
.chat-message.user .message-bubble a {
    color: white !important;
    text-decoration: underline !important;
    font-weight: 600;
}

.chat-message.user .message-bubble a:hover {
    color: #f0f0f0 !important;
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-message.user .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.chat-message.admin .message-bubble {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(216, 111, 48, 0.3);
    color: #1a140e;
    border-bottom-left-radius: 6px;
    margin-left: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.chat-message.admin .message-bubble::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #d86f30 0%, #e67e22 100%);
    border-radius: 0 2px 2px 0;
}

/* Special style for admin messages with an hourglass icon (from chat_mobile.css) */
.chat-message.admin .message-bubble:has(.fa-hourglass-half) {
    background: rgba(216, 111, 48, 0.15);
    border: 2px solid rgba(216, 111, 48, 0.4);
    font-weight: 600;
}

.message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message-time {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 4px;
    padding: 0 14px;
}

/* Chat Input Container */
.chat-input-container {
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(216, 111, 48, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    box-shadow: 0 -4px 20px rgba(216, 111, 48, 0.08);
}

.chat-input-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    position: relative;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
    background: #ffffff; /* Fra chat_mobile.css, foretrækkes over den orange fra chatcomp.css */
    border: 2px solid rgba(216, 111, 48, 0.25);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 
        0 2px 10px rgba(216, 111, 48, 0.1),
        inset 0 1px 3px rgba(216, 111, 48, 0.05);
    /* `height: 50px; display: flex; align-items: stretch;` fra chatcomp.css kan fjernes
       da min-height og padding i .chat-input giver fleksibilitet, og den er i en flex-container. */
}

.chat-input-wrapper:focus-within {
    border-color: #d86f30;
    background: #ffffff;
    box-shadow: 
        0 0 0 3px rgba(216, 111, 48, 0.15),
        0 4px 20px rgba(216, 111, 48, 0.2),
        inset 0 1px 3px rgba(216, 111, 48, 0.1);
    transform: translateY(-2px);
}

.chat-input {
    width: 100%;
    padding: 14px 18px; /* Fra chat_mobile.css for bedre kontrol */
    border: none;
    background: transparent; /* Fra chat_mobile.css */
    font-size: 0.95rem;
    resize: none;
    min-height: 22px; /* Fra chat_mobile.css */
    max-height: 100px; /* Fra chat_mobile.css */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    outline: none;
    color: #1a140e;
    line-height: 1.4;
    scrollbar-width: thin;
    scrollbar-color: rgba(216, 111, 48, 0.3) transparent;
    -webkit-appearance: none; /* Fra chat_mobile.css */
    -webkit-tap-highlight-color: transparent; /* Fra chat_mobile.css */
    
    /* Fix for dobbelt border/outline fra chat_mobile.css */
    box-shadow: none !important;
    border: 0 !important;
    outline: 0 !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    /* `border-radius: 20px; box-sizing: border-box; display: block; vertical-align: top; scrollbar-gutter: stable;`
       Disse kan potentielt fjernes da wrapperen håndterer det meste, men de skader ikke. */
}

.chat-input::-webkit-scrollbar {
    width: 6px;
}

.chat-input::-webkit-scrollbar-track {
    background: rgba(216, 111, 48, 0.05);
    border-radius: 10px;
    margin: 2px; /* Fra chat_mobile.css, lidt strammere */
}

.chat-input::-webkit-scrollbar-thumb {
    background: rgba(216, 111, 48, 0.3);
    border-radius: 10px;
    border: 1px solid #ffffff;
}

.chat-input::-webkit-scrollbar-thumb:hover {
    background: rgba(216, 111, 48, 0.5);
}

.chat-input::placeholder {
    color: rgba(75, 60, 42, 0.6);
    font-style: normal;
    font-weight: 400;
}

.chat-input:disabled {
    background-color: #f1f1f1;
    cursor: not-allowed;
    opacity: 0.7;
}

.chat-send {
    background: linear-gradient(135deg, #d86f30 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 50%;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 2px 10px rgba(216, 111, 48, 0.3),
        0 0 0 1px rgba(216, 111, 48, 0.1);
    -webkit-tap-highlight-color: transparent; /* Fra chat_mobile.css */
    touch-action: manipulation; /* Fra chat_mobile.css */
}

.chat-send::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.3s ease;
}

.chat-send:hover {
    background: linear-gradient(135deg, #c8642b 0%, #d9721e 100%);
    transform: scale(1.1) translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(216, 111, 48, 0.4),
        0 0 0 1px rgba(216, 111, 48, 0.2);
}

.chat-send:hover::before {
    left: 100%;
}

.chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 10px rgba(216, 111, 48, 0.15);
}

.chat-send:disabled:hover::before {
    left: -100%;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: #8b7355;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(216, 111, 48, 0.1);
    background: linear-gradient(135deg, 
        rgba(216, 111, 48, 0.03) 0%, 
        rgba(255, 255, 255, 0.8) 100%);
    position: relative;
    user-select: none; /* Fra chat_mobile.css */
}

.welcome-message::before {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.support-status-banner {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4; /* Fra chat_mobile.css */
    user-select: none; /* Fra chat_mobile.css */
}

.banner-content {
    line-height: 1.4;
}

/* Stil for afslutningsbesked (session-closed) */
.session-closed {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.session-closed .message-bubble {
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid rgba(216, 111, 48, 0.2);
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: visible !important;
    max-width: 100% !important;
    margin: 0 !important;
    word-wrap: break-word;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
}

.session-closed .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-radius: 16px 16px 0 0;
}

.session-closed .message-bubble .start-new-chat {
    margin-top: 0;
    flex-shrink: 0;
}

/* Stil for vurderingscontainer (rating-container) */
.rating-container {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.rating-container .message-bubble {
    text-align: center;
    background: linear-gradient(135deg, #fff7ed 0%, #fef3e2 100%);
    border: 2px solid rgba(216, 111, 48, 0.2);
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 4px 16px rgba(216, 111, 48, 0.1);
    position: relative;
    overflow: visible !important;
    max-width: 100% !important;
    margin: 0 !important;
    word-wrap: break-word;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.rating-container .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #d86f30 0%, #e67e22 100%);
    border-radius: 16px 16px 0 0;
}

.rating-container .message-bubble h4 {
    margin: 0 0 6px 0;
    color: #1a140e;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.rating-container .message-bubble p {
    margin: 0 0 12px 0;
    color: #4a4a4a;
    font-size: 0.9rem;
    line-height: 1.3;
}

/* Stil for vurderingsstjerner */
.rating-stars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 12px 0 16px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border: 1px solid rgba(216, 111, 48, 0.1);
    flex-wrap: nowrap;
    min-height: 50px;
    flex-shrink: 0;
}

.star {
    font-size: 24px;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    user-select: none;
    position: relative;
    display: inline-block;
    line-height: 1;
    flex-shrink: 0;
    width: 30px;
    text-align: center;
}

.star:hover {
    color: #fbbf24;
    transform: scale(1.1);
    text-shadow: 0 4px 8px rgba(251, 191, 36, 0.4);
}

.star.selected {
    color: #f59e0b;
    transform: scale(1.05);
    text-shadow: 0 4px 8px rgba(245, 158, 11, 0.4);
}

.star:focus {
    outline: 2px solid rgba(216, 111, 48, 0.4);
    outline-offset: 3px;
    border-radius: 3px;
}

.star:active {
    transform: scale(0.95);
}

/* Hover effect for stjerner */
.rating-stars:hover .star:not(:hover) {
    color: #cbd5e1;
    transform: scale(0.95);
}

/* Knapper container */
.rating-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    width: 100%;
    flex-shrink: 0;
}

/* Stil for Spring over-knappen */
.skip-rating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 2px solid rgba(108, 117, 125, 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    min-width: 100px;
    flex-shrink: 0;
}

.skip-rating:hover {
    background: rgba(108, 117, 125, 0.15);
    border-color: rgba(108, 117, 125, 0.3);
    color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(108, 117, 125, 0.2);
}

.skip-rating:focus {
    outline: 2px solid rgba(108, 117, 125, 0.3);
    outline-offset: 2px;
}

.skip-rating:active {
    transform: translateY(0);
}

/* Stil for Start ny chat-knappen */
.start-new-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    background: linear-gradient(135deg, #d86f30 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    min-width: 110px;
    box-shadow: 0 3px 8px rgba(216, 111, 48, 0.3);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.start-new-chat::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.3s ease;
}

.start-new-chat:hover {
    background: linear-gradient(135deg, #c8642b 0%, #d9721e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(216, 111, 48, 0.4);
}

.start-new-chat:hover::before {
    left: 100%;
}

.start-new-chat:focus {
    outline: 2px solid rgba(216, 111, 48, 0.4);
    outline-offset: 2px;
}

.start-new-chat:active {
    transform: translateY(0);
}

/* Typing indicator styles */
.typing-indicator .message-bubble {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(216, 111, 48, 0.2);
    color: #666;
    font-style: italic;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: typingPulse 2s ease-in-out infinite;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #d86f30;
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

.typing-text {
    font-size: 0.85rem;
    color: #666;
}

/* ========================================================================= */
/*  4. ANIMATIONS (Fælles Keyframes)
/* ========================================================================= */
@keyframes chatPulse {
    0%, 100% { 
        box-shadow: 
            0 8px 25px rgba(216, 111, 48, 0.3),
            0 0 0 1px rgba(216, 111, 48, 0.1),
            0 0 0 0px rgba(216, 111, 48, 0.3);
    }
    50% { 
        box-shadow: 
            0 8px 25px rgba(216, 111, 48, 0.3),
            0 0 0 1px rgba(216, 111, 48, 0.1),
            0 0 0 20px rgba(216, 111, 48, 0.1);
    }
}

@keyframes slideInFadeIn {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes chatSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes typingPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* ========================================================================= */
/*  5. RESPONSIVE MEDIA QUERIES
    Styrer, hvilke knapper der vises, og justerer widget- og site-styles
    baseret på skærmstørrelse.
/* ========================================================================= */

/* Standard desktop (over 768px) */
@media (min-width: 769px) {
    .chat-button-desktop {
        display: flex; /* Vis den store, runde knap */
    }
    .chat-button-mobile {
        display: none; /* Skjul den smalle, lodrette knap */
    }

    /* Justeringer for desktop menu (fra chat_mobile.css) */
    .header-content {
        padding: 15px 0; /* Standard padding */
    }
    .menu-toggle {
        display: none;
    }
    nav {
        display: flex;
        position: static;
        width: auto;
        box-shadow: none;
    }
    nav ul {
        flex-direction: row;
        padding: 0;
    }
    /* FJERNET PROBLEMATISKE REGEL: nav ul li { margin-left: 20px; } */
    /* Denne regel skubbede login-knappen for langt til højre på iPad landscape */
    
    .dropdown-content {
        position: absolute;
        box-shadow: var(--shadow);
        background: #fff;
        width: auto;
        padding: 0;
    }
}


/* Tablette og Mobil (768px og ned) */
@media (max-width: 768px) {
    .chat-button-desktop {
        display: none; /* Skjul den store, runde knap */
    }
    .chat-button-mobile {
        display: flex; /* Vis den smalle, lodrette knap */
        width: 20px; /* Jf. chat_mobile.css for 768px */
        height: 125px; /* Jf. chat_mobile.css for 768px */
        bottom: 90px; /* Jf. chat_mobile.css for 768px */
    }
    .chat-button-mobile .chat-text {
        font-size: 0.65rem; /* Jf. chat_mobile.css for 768px */
    }
    .chat-button-mobile:hover,
    .chat-button-mobile:focus {
        width: 22px; /* Jf. chat_mobile.css for 768px */
    }

    /* Justeringer af chat-widget for tablet/mobil */
    .chat-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
        border-radius: 16px;
    }
    
    .chat-header {
        padding: 16px 20px;
    }
    
    .chat-header h3 {
        font-size: 1rem;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-container {
        padding: 16px;
    }
    
    .message-bubble {
        max-width: 85%;
        font-size: 0.95rem;
    }
    
    .welcome-message {
        padding: 16px;
        font-size: 0.95rem;
    }
    
    .welcome-message::before {
        font-size: 1.8rem;
    }
    
    /* Mobil rating justeringer */
    .rating-container .message-bubble {
        padding: 16px 12px;
        min-height: 180px;
        max-width: 98% !important;
    }
    
    .rating-container .message-bubble h4 {
        font-size: 0.95rem;
        margin-bottom: 4px;
    }
    
    .rating-container .message-bubble p {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .rating-stars {
        gap: 4px;
        margin: 8px 0 12px 0;
        padding: 8px;
        min-height: 45px;
    }
    
    .star {
        font-size: 22px;
        width: 26px;
    }
    
    .rating-buttons {
        flex-direction: column;
        gap: 6px;
        margin-top: 8px;
    }
    
    .skip-rating,
    .start-new-chat {
        min-width: 140px;
        padding: 10px 16px;
        font-size: 12px;
    }

    /* Generelle mobil menu justeringer (fra chat_mobile.css) */
    .header-content {
        position: relative;
    }
    .menu-toggle {
        display: block;
    }
    nav {
        display: none; /* Skjult som standard, aktiveres af JS med .active */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-color);
        box-shadow: var(--shadow);
        z-index: 10;
    }
    nav.active {
        display: block;
    }
    nav ul {
        flex-direction: column;
        padding: 15px 0;
    }
    nav ul li {
        margin: 10px 0;
        text-align: center;
    }
    nav ul li a {
        padding: 12px;
        font-size: 18px;
    }
    .dropdown-content {
        position: static;
        box-shadow: none;
        background: none;
        width: 100%;
        padding-left: 20px;
    }

    /* Checkout sektion justeringer */
    .checkout-section h1 {
        font-size: 2rem;
    }
    .checkout-section p {
        font-size: 16px;
    }
    .purchase-form {
        padding: 20px;
        max-width: 100%;
    }
    .purchase-form input[type="email"],
    .purchase-form input[type="password"] {
        font-size: 14px;
    }
    .purchase-form button {
        padding: 10px 20px;
        font-size: 14px;
    }
    .flash-messages li {
        font-size: 14px;
    }
}

/* Landskabs-orientering på små skærme (fra chat_mobile.css) */
@media (max-width: 640px) and (orientation: landscape) {
    .chat-widget {
        height: calc(100vh - 100px);
        max-height: 400px;
    }
    
    .chat-button-mobile {
        width: 14px;
        height: 80px;
        bottom: 80px;
    }
    
    .chat-header {
        padding: 12px 16px;
    }
    
    .chat-messages {
        padding: 12px;
    }
    
    .chat-input-container {
        padding: 12px;
    }
}

/* Små mobilskærme (fra chat_mobile.css) */
@media (max-width: 480px) {
    .chat-widget {
        width: calc(100vw - 20px);
        height: calc(100vh - 120px);
        bottom: 10px;
        right: 10px;
        left: 10px;
        border-radius: 12px;
        max-height: calc(100vh - 120px);
    }

    .chat-button-mobile {
        width: 18px;
        height: 120px;
        bottom: 80px;
    }

    .chat-button-mobile .chat-text {
        font-size: 0.6rem;
        letter-spacing: 0.5px;
    }

    .chat-button-mobile:hover,
    .chat-button-mobile:focus {
        width: 20px;
    }

    .chat-header {
        padding: 14px 16px;
    }
    
    .chat-header h3 {
        font-size: 0.95rem;
    }
    
    .chat-close {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        padding: 6px;
    }

    .chat-messages {
        padding: 12px;
    }
    
    .message-bubble {
        max-width: 90%;
        padding: 10px 14px;
        font-size: 0.9rem;
        border-radius: 16px;
    }
    
    .chat-message.user .message-bubble {
        border-bottom-right-radius: 4px;
    }
    
    .chat-message.admin .message-bubble {
        border-bottom-left-radius: 4px;
        margin-left: 8px;
    }
    
    .message-time {
        font-size: 0.7rem;
        padding: 0 12px;
    }

    .chat-input-container {
        padding: 12px;
    }
    
    .chat-input-form {
        gap: 10px;
    }
    
    .chat-input {
        font-size: 16px;
        padding: 12px 16px;
        border-radius: 18px;
    }
    
    .chat-input-wrapper {
        border-radius: 18px;
    }
    
    .chat-send {
        width: 42px;
        height: 42px;
        padding: 11px;
        font-size: 0.9rem;
    }
    
    .welcome-message {
        padding: 14px;
        font-size: 0.85rem;
    }
    
    .welcome-message::before {
        font-size: 1.6rem;
    }
    
    .support-status-banner {
        padding: 10px;
        font-size: 13px;
        border-radius: 6px;
        margin-bottom: 10px;
    }
    
    /* Mindre mobil rating justeringer */
    .rating-container .message-bubble {
        padding: 14px 10px;
        min-height: 160px;
    }
    
    .rating-container .message-bubble h4 {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
    
    .rating-container .message-bubble p {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .rating-stars {
        gap: 3px;
        margin: 6px 0 10px 0;
        padding: 6px;
        min-height: 40px;
    }
    
    .star {
        font-size: 20px;
        width: 24px;
    }
    
    .rating-buttons {
        gap: 4px;
        margin-top: 6px;
    }
    
    .skip-rating,
    .start-new-chat {
        min-width: 120px;
        padding: 8px 14px;
        font-size: 11px;
    }

    /* Checkout sektion justeringer */
    .checkout-section h1 {
        font-size: 1.8rem;
    }
    .checkout-section p {
        font-size: 14px;
        margin-bottom: 20px;
    }
    .purchase-form {
        padding: 15px;
    }
    .purchase-form input[type="email"],
    .purchase-form input[type="password"] {
        font-size: 12px;
        padding: 8px;
        margin-bottom: 15px;
    }
    .purchase-form button {
        padding: 8px 16px;
        font-size: 12px;
    }
    .flash-messages li {
        font-size: 12px;
        padding: 8px;
    }
}

/* Ekstra små mobilskærme (fra chat_mobile.css) */
@media (max-width: 360px) {
    .chat-widget {
        width: calc(100vw - 16px);
        height: calc(100vh - 100px);
        bottom: 8px;
        right: 8px;
        left: 8px;
    }

    .chat-button-mobile {
        width: 16px;
        height: 110px;
        bottom: 70px;
    }

    .chat-button-mobile .chat-text {
        font-size: 0.55rem;
    }

    .chat-button-mobile:hover,
    .chat-button-mobile:focus {
        width: 18px;
    }
    
    .chat-header {
        padding: 12px 14px;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .chat-input-container {
        padding: 10px;
    }
    
    .message-bubble {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .welcome-message {
        padding: 12px;
        font-size: 0.8rem;
    }
    
    /* Ekstra små mobil rating justeringer */
    .rating-container .message-bubble {
        padding: 12px 8px;
        min-height: 140px;
    }
    
    .rating-container .message-bubble h4 {
        font-size: 0.85rem;
    }
    
    .rating-container .message-bubble p {
        font-size: 0.75rem;
    }
    
    .rating-stars {
        gap: 2px;
        margin: 4px 0 8px 0;
        padding: 4px;
        min-height: 35px;
    }
    
    .star {
        font-size: 18px;
        width: 22px;
    }
    
    .skip-rating,
    .start-new-chat {
        min-width: 100px;
        padding: 6px 12px;
        font-size: 10px;
    }
}

/* High DPI displays (fra chat_mobile.css) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .chat-button-desktop,
    .chat-button-mobile,
    .chat-send,
    .chat-close {
        box-shadow: 
            0 1px 3px rgba(216, 111, 48, 0.2),
            0 1px 2px rgba(216, 111, 48, 0.15);
    }
}

/* Dark mode support (fra chat_mobile.css) */
@media (prefers-color-scheme: dark) {
    .chat-widget {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(216, 111, 48, 0.3);
    }
    
    .chat-messages {
        background: linear-gradient(145deg, 
            rgba(40, 40, 40, 0.8) 0%, 
            rgba(30, 30, 30, 0.9) 100%);
    }
    
    .chat-message.admin .message-bubble {
        background: rgba(50, 50, 50, 0.95);
        border-color: rgba(216, 111, 48, 0.4);
        color: #e0e0e0;
    }
    
    .rating-container .message-bubble {
        background: linear-gradient(135deg, rgba(50, 50, 50, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
        border-color: rgba(216, 111, 48, 0.4);
    }
    
    .rating-container .message-bubble h4 {
        color: #e0e0e0;
    }
    
    .rating-container .message-bubble p {
        color: #b0b0b0;
    }
    
    .rating-stars {
        background: rgba(60, 60, 60, 0.8);
        border-color: rgba(216, 111, 48, 0.2);
    }
    
    .skip-rating {
        background: rgba(108, 117, 125, 0.2);
        color: #e0e0e0;
        border-color: rgba(108, 117, 125, 0.3);
    }
    
    .skip-rating:hover {
        background: rgba(108, 117, 125, 0.3);
        color: #f0f0f0;
    }
    
    .session-closed .message-bubble {
        background: linear-gradient(135deg, rgba(50, 50, 50, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
        border-color: rgba(216, 111, 48, 0.4);
        color: #e0e0e0;
    }
    
    .chat-input-wrapper {
        background: rgba(50, 50, 50, 0.8);
        border-color: rgba(216, 111, 48, 0.3);
    }
    
    .chat-input {
        color: #e0e0e0;
    }
    
    .chat-input::placeholder {
        color: rgba(200, 200, 200, 0.6);
    }
    
    .support-status-banner {
        background: rgba(50, 50, 50, 0.8);
        border-color: rgba(216, 111, 48, 0.3);
        color: #b0b0b0;
    }
    
    .chat-button-desktop,
    .chat-button-mobile { /* Både desktop og mobil knap i dark mode */
        background: #d86f30;
        color: #ffffff;
    }
    
    .chat-button-desktop:hover,
    .chat-button-desktop:focus,
    .chat-button-mobile:hover,
    .chat-button-mobile:focus {
        background: #e67e22;
        color: #ffffff;
    }
    
    .typing-indicator .message-bubble {
        background: rgba(50, 50, 50, 0.95);
        border-color: rgba(216, 111, 48, 0.4);
        color: #b0b0b0;
    }
}

/* Reduced motion support (fra chat_mobile.css) */
@media (prefers-reduced-motion: reduce) {
    .chat-button-desktop,
    .chat-button-mobile,
    .chat-widget,
    .message-bubble,
    .chat-send {
        animation: none !important; /* Brug !important for at sikre override */
        transition: none !important;
    }
    
    .chat-widget.show {
        animation: none !important;
    }
    
    .welcome-message::before {
        animation: none !important;
    }
    
    .status-indicator {
        animation: none !important;
    }
    
    .star {
        transition: none !important;
    }
    
    .typing-dots span {
        animation: none !important;
    }
    
    .typing-indicator .message-bubble {
        animation: none !important;
    }

    /* Også for generelle sidestyles */
    *, *:before, *:after {
        transition: none !important;
        transform: none !important;
        animation: none !important;
    }
}


/* ========================================================================= */
/*  6. FONT IMPORTERING
    Disse bør enten være direkte URL'er til Google Fonts (eller lignende),
    eller relative stier til dine lokale fontfiler.
    Jeg har erstattet dem med generiske relative stier.
/* ========================================================================= */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 300;
    src: url('../static/fonts/Poppins-Light.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    src: url('../static/fonts/Poppins-Medium.ttf') format('truetype');
    font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    src: url('../static/fonts/Poppins-Bold.ttf') format('truetype');
    font-display: swap;
}