/* Nulstil margin og sørg for at højde beregnes korrekt */
* { box-sizing: border-box; margin: 0; padding: 0; }

body, html { 
    margin: 0;
    padding: 0;
    height: 100%; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: bold;
    background-color: #0e0e0f;
    overflow: hidden;
    color: #29fd2f;
}

::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
}

/* Skjul scrollbar for Chrome, Safari og Opera */
#chatbox::-webkit-scrollbar {
    display: none;
}

/* Skjul scrollbar for Firefox og IE/Edge */
#chatbox {
    -ms-overflow-style: none;  /* IE og Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Containeren fylder nu hele skærmen */
#chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    position: relative;
    background: #0e0e0f;
}

/* Selve chatvinduet fylder alt ledig plads */
#chatbox {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 15px 250px 15px; 
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* AI Status indikator i toppen af chatten */
#ai-status {
    text-align: center;
    font-size: 12px;
    color: #888;
    font-weight: normal;
    padding: 4px 0;
}

/* Boblerne - Messenger stil */
.message { 
    width: fit-content;    
    max-width: 85%;        
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    font-size: 15px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Brugerens beskeder */
.user { 
    align-self: flex-end; 
    text-align: left;    
    background-color: #303030; 
    color: #ffffff;
    border-bottom-right-radius: 4px; 
}

/* Bottens beskeder */
.bot { 
    align-self: flex-start; 
    background-color: #141415; 
    color: #29fd2f;
    border-bottom-left-radius: 4px;
    border: 1px solid #222;
}

.typing {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #29fd2f;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Tidspunkt under beskeder */
.time { 
    display: block;
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.5;
    font-weight: 400; 
}

.user .time { color: #ffffff; text-align: right; }
.bot .time { color: #888; text-align: left; }

/* Input-området fastgjort i bunden */
.input-area {
    position: fixed;
    bottom: 25px;      
    left: 50%;          
    transform: translateX(-50%); 
    width: 90%;        
    max-width: 700px;  
    background: #242424; 
    padding: 0px 16px;
    border-radius: 24px;
    display: flex;
    flex-direction: column; 
    gap: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    border: 1px solid #333;
    z-index: 1000;
}

textarea {
    flex: 1;
    border: none;
    background: transparent;
    color: white;
    padding: 25px 4px;
    outline: none;
    font-size: 16px;
    resize: none;      
    max-height: 200px;  
    font-family: inherit;
    line-height: 1.5;
}

.button-group {
    display: flex;
    justify-content: center; 
    gap: 12px;
}

button {
    background: transparent;
    color: #00ff00; 
    border: none;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    transition: opacity 0.2s;
}

/* Deaktiveret knap mens AI'en træner */
button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.reset-btn {
    color: #ff4444; 
}

button:active:not(:disabled) { 
    opacity: 0.5; 
}