* {     
    margin: 0;
    padding: 0;
    box-sizing: border-box; 
    font-family: 'roboto', sans-serif;
}


html, body{
    height: 100%;
    margin: 0;
    padding: 0;
}    




body {
    background: rgb(237, 236, 236);
    margin: 0;
    font-family: sans-serif;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    color: rgb(27, 27, 27);

    height: 100vh; 
    overflow: hidden;
}




 h1 {
    text-align: center;
    font-family: "permanent-Marker", Arial, Helvetica, sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0.25, 0.7);
    color: rgb(0, 0, 0); 
}

#shopa-header {
    /* font-size: 2.5rem;
    font-weight: bold;
    margin: 20px 0;
    color: rgb(0, 0, 255);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 720px;
    padding: 0 12px;
    box-sizing: border-box; */

  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 auto;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 900px;
  padding: 0 16px;

  flex-shrink: 0; /*damit header nicht schrinkt*/
    
}

#auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

#newChatBtn {
    padding: auto;
    gap: 20px; 
    right: 70px; 
    position: fixed;
    width: 70px;; 
    height: 30px;
    border-radius:  8px;
    border: none;
    transition: transform 0.2s;
    top: 25px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.769);
    color: white;
} 

#newChatBtn:hover{
transform: scale(1.13);
background: rgba(95, 95, 95, 0.313);
color: black;
transition: transform 0.2s, background 0.3s, color 0.3s;

}


#loginBtn{
    padding: 8px 16px;
    font-size: 0.9rem;
    padding: 5px;
    width: 45px;
    height: 45px;
    background: none; /* #16e8a251;    #000000ac; */
    border: none;
    border-radius: 6px;
    color: #0f0f0f;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;  
}

#logoutBtn {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: none;   /* #000000ac; früher width und height 45px*/
    border: none;
    border-radius: 6px;
    color: #0f0f0f;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;  
    color: rgb(230, 105, 105);
}


#loginBtn:hover, #logoutBtn:hover {
transform: scale(1.05);
}

#inputByUser {
    width: 80%;
    font-size: 1.2rem;
    min-height: 48px; 
    max-height: 120px;
    margin-bottom: 10px;
    align-items: center;
    z-index: 1000;
    background: rgba(43, 43, 43, 0.557);  /*rgb(33, 33, 33);       noch eine andere gute farbe  rgba(15, 215, 172, 0.557);*/
    color: white;


    resize: vertical;
    box-sizing: border-box;
    overflow-y: auto;
    height: auto;
    transition: border-color 2s;


  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 15px;
}

#inputByUser::placeholder {
    color: rgba(226, 222, 222, 0.5);
}

#inputByUser:focus{
    outline: none;
    border-color: rgb(0, 0, 0);
    box-shadow: #363434;
}

#inputByUser::-webkit-scrollbar{
    width: 3px;
}

#inputByUser::-webkit-scrollbar-track {
    background: rgb(255, 255, 255);  
    border-radius: 50px;
    max-height: 8px; 
}

#inputByUser::-webkit-scrollbar-thumb{
    background: #1e1e1e;
    border-radius: 50px;
    max-height: 8px;
    
}


#sendButton {

  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
    }

#sendButton:hover {
  background-color:  rgba(47, 47, 47, 0.112);   /* #363434;*/
  transform: scale(1.13);
}

/*#sendButton svg path {
  fill: white;
} */
  
#bottomContainer{
    position: fixed;
    bottom: 20px; 
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
   background: rgba(82, 82, 82, 0.164);
   backdrop-filter: blur(12px);
   padding: 12px;
   border-radius: 24px;
   width: calc(85% - 32px);  /*früher 85%-32px*/
   max-width: 600px;
  

  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.27),
    inset 0 1px 0 rgba(255,255,255,0.4);

}

#app {
  /*width: 100%;
    max-width: 720px;
    padding: 8px 12px 16px 12px;
    box-sizing: border-box;

    flex: 1; 
    padding-bottom: 120px; */

    width: 100%;
    max-width: 900px;
    padding: 8px 12px 16px 12px;
    box-sizing: border-box;
    flex: 1; /* Nimmt verfügbaren Platz */
    display: flex;
    flex-direction: column;
    min-height: 0; /* WICHTIG für Flexbox Scrolling */
    margin: 0 auto; /* Zentrieren */
}

#chat-wrapper {
    flex: 1;  
    overflow-y: auto; 
    overflow-x: hidden;
    min-height: 0;
    margin-bottom: 90px;  /*120px*/
    
}

#conversation-indicator {
    text-align: center;
    opacity: 0.7;
    margin-bottom: 8px;
    font-size: 14px;
    }

#chat-container {
    display: flex;
    flex-direction: column; /* wichtigg für Alignment */
    gap: 8px;
    padding-right: 8px;
    padding-bottom: 10px;
    min-height: min-content; /* Passt sich Inhalt an */
   
   
   
    /* height: 100%;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 8px;

    overflow: visible;
    padding-bottom: 20px; 
    max-height: calc(100vh - 120px); 
    overflow-y: auto; */
   }

#chat-container::-webkit-scrollbar {
    width: 6px;
    }

#chat-container::-webkit-scrollbar-track {
    background: rgba(244, 0, 0, 0.05);
    border-radius: 10px;
    }

#chat-container::-webkit-scrollbar-thumb {
    background: rgba(0, 174, 255, 0.3);
    border-radius: 10px;
    }

#chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 174, 255, 0.5);
}

.msg {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 12px;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.2s;

    max-width: 68%;
    padding: 12px 14px;
    border-radius: 18px;
    line-height: 1.45;
    font-size: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.msg:hover {

  transform: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.msg.user{
    background: rgb(210, 210, 210);
    color:#081018;
    /*align-self:flex-end; */
    overflow-wrap: break-word;   
    word-wrap: break-word;  
    hyphens: auto;
    max-width: 70%;
    line-height: 1.4;

    margin-left: auto;
    align-self:flex-end;

    /*align-self: flex-end;
    margin-left: auto;
    margin-right: 8px; 
    max-width: 70%; 
    background: rgb(210, 210, 210); 
    color: #081018; */
}




.msg.assistant {
    background: rgba(0, 0, 0, 0.502);
    color: #ffffff;
    align-self: flex-start;  /* Links ausrichten */
    margin-right: auto;      /* Nach links schieben */
    margin-left: 0;          /* Kein linker Abstand */
    max-width: 70%;
    overflow-wrap: break-word;   
    word-wrap: break-word;     
    hyphens: auto;
}


.msg .meta {
 font-size: 11px;
 opacity: 0.7;
 margin-top: 6px; 
}


#input-container {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

#pinButton{
    padding: 5px;
    width: 45px; /*altes design: width: 45px*/
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0);/*rgba(0, 0, 0, 0.116);*/
    border:none;
    font-size:20px;
    color: #ffffff; /*#2653eb*/
    cursor: pointer;
    transition: transform 0.2s;
}

#pinButton:hover {
    transform: scale(1.13);
    background: #3f3f3f1d; 
}

       
.settings-Modal{
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7); 
    z-index: 2000;
    backdrop-filter: blur(4px);
    }

.settings-Modal.active {
    display: flex;
    }

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    /*background: rgba(0,0,0,0.7);*/
    z-index: 2000;
    backdrop-filter: blur(4px);

    
    background: rgba(0, 0, 0, 0.2);

    }

.modal-overlay.active {
    display: flex;
}

/* Form Box Styling */

.form-box {
    width: 100%;
    max-width: 450px; 
    padding: 30px;
    background-color: #00000078;  /*rgba(241, 241, 241, 0.977);*/
    backdrop-filter: blur(18px);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.79);
    margin: 0 15px;
}

.form-box h2 {
    font-size: 34px;
    text-align: center;
    margin-bottom: 20px;
    color: rgba(13, 13, 13, 0.826);
}

.form-box input {
    width: 100%;
    padding: 12px;
    background: rgb(8, 8, 8); /*farbe war 184,184,184*/
    border-radius: 22px;
    outline: none;
    border: none; 
    font-size: 16px;
    color: rgb(255, 255, 255);
    margin-bottom: 20px;
}

.form-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-box button {
    width: 100%;
    padding: 12px;
    /*background: rgba(28, 28, 28, 0.473); */
    background: rgb(41, 41, 41);
    color: white;
    border: none;
    outline: none;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.5s;
    font-weight: bold;
    }

.form-box button:hover {
    background: #00000078;
    color: white;
}

.form-box p {
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
    color: #0f0f0f;
}

.form-box p a {
    color: rgb(17, 17, 17);              /*color: rgb(150, 156, 158); */
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
}

.form-box p a:hover {
    text-decoration: underline;
}

#closeResetModalBtn {
    position: absolute; 
    top: 10px;  
    left: 140px;

    color: black; 
    background: none; 
    border: none;
    font-size: 16px; 
    cursor: pointer;
    font-weight: bold;
}

#closeLoginModalBtn {
    position: absolute; 
    top: 10px;  
    left: 140px;

    color: black; 
    background: none; 
    border: none;
    font-size: 16px; 
    cursor: pointer;
    font-weight: bold;
}
 
#closeRegisterModalBtn {
    position: absolute; 
    top: 10px;  
    left: 140px;

    color: black; 
    background: none; 
    border: none;
    font-size: 16px; 
    cursor: pointer;
    font-weight: bold;
}

#loginModal .form-box{
    background: #00000078;
    backdrop-filter: blur(18px);
    /*background: rgba(0, 0, 0, 0.48);*/
}
        


#chat-container{
    width: 100%;
}

#chat-wrapper{
    width: 100%;

}

#chat-wrapper::-webkit-scrollbar{
    background: rgba(110, 109, 109, 0);
}


        
#settingsBtn {
    padding: 8px 16px;
    font-size: 1.2rem;
    padding: 5px;
    width: 45px;
    height: 45px;
    background: none;
    border: none;
    border-radius: 6px;
    color: #0f0f0f;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;

    position: fixed; 
    right: 16px;
    top: 20px;

}

#settingsBtn:hover {
    transform: scale(1.05);
    background: #2828283d;
}

/* Settings Modal spezifische Styles */
.settings-box {
    max-width: 500px;
}

.settings-section {
    margin-bottom: 10px;  /*24px, 20px*/
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    
}

.settings-section:last-of-type {
    border-bottom: none;
}

.settings-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #000000;   /* #515151;*/
}

.settings-section p {
    font-size: 14px;
    color: #21212166;
    margin: 8px 0;
}

#userEmailDisplay {
    font-weight: 500;
    color: #000000;
}


#closeSettingsBtn {
    background: rgb(18, 18, 18);
    text-align: center;
    display: none;
}

#support-Section {
    margin-bottom: 30px;
}

#support-Section a{
    color: rgba(50, 215, 182, 0.788);
    font-size: 15px;

}

#impressumHTML h4{
    font-size: 15px;
}

#impressumHTML a{
    color: rgba(50, 215, 182, 0.788);
    font-size: 11px;
    
    
}



.settings-button {
    width: 100%;
    padding: 12px, 14px;
    border: none;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
    margin-top: 21px;
    text-align: left;
    

}

/*.logout-button {
    background: #e8161651;
    color: #333;
}

.logout-button:hover {
    background: #e81616;
    color: white;                     profileDeleteBtn
} */


.settings-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.settings-footer .settings-button {
    background: none;
}


.settings-footer .settings-button:hover {
    background: rgb(0, 0, 0);
    color: rgb(201, 201, 201);
}

/* SETTINGS POPOVER (oben rechts) */
.settings-popover {
    position: absolute;
    top: 60px;              /* unter Header */
    right: 16px;            /* rechts ausgerichtet */
    display: none;
    z-index: 3000;
}

/* sichtbar */
.settings-popover.active {
    display: block;
}

/* kleinere Box */
.settings-box {
    width: 320px;
    max-width: calc(100vw - 50px);
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    background: #00000078;
    backdrop-filter: blur(18px);

    overflow-x: hidden;
}

/* Titel kleiner */
.settings-box h2 {
    font-size: 20px;
    margin-bottom: 16px;
}


#settingsSection-impressumHTML {
    font-size: 19px;
    transition: transform 0.3s;
}

#settings-impressum:hover{
    transform: scale(1.05);
}

/*neuer profil popover und button bereich */
#profileBtn {
    background: rgba(18, 18, 18, 0);
    color: #000000;
    width: 100%;
    padding: 12px;
    border: none;
    outline: none;
    font-size: 16px;
    border-radius: 32px;
    cursor: pointer;
    transition: 0.9s;
    font-weight: bold;
    text-align: left;
    margin-top: 0;
    margin-bottom: 0;
}

#profileBtn:hover {
    background: rgb(0, 0, 0);
    color: rgb(160, 160, 160);
    font-size: 17px;
}






/*#profileModal .profile-box button {
    width: 100%;
    padding: 12px;
    border: none;
    outline: none;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
    background: rgb(18, 18, 18);
    color: #ff0000;
} */



.profile-popover {
    position: fixed;
    display: none;
    z-index: 5000;
    top: 64px;
    right: 16px; 
}

.profile-popover.active {
    display: block;
} 

.profile-box {
    width: 280px;
    max-width: calc(100vw - 50px);
    padding: 20px;
    border-radius: 12px;
    background: #00000078;
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    gap: 12px;
    display: flex; 
    flex-direction: column; 


}


#profileDeleteBtn{
    padding: 8px 16px;
    font-size: 0.9rem;
    background: none;   /* zeile 115 für logoutbtn */
    border: none;
    border-radius: 6px;
    color: #0f0f0f;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;  
    color: rgb(99, 0, 0);
    align-items: right;
    height: auto; 
    text-align: left;
}

#profileDeleteBtn:hover{
   transform: scale(1.05);
}

#profileCloseBtn{
    padding: 8px 16px;
    font-size: 0.9rem;
    background: black;
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;  
    align-items: right;
    height: auto; 
    
}

#profileCloseBtn:hover{
    transform: scale(1.05);
}

#changePasswordBtn {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: none;   /* zeile 115 für logoutbtn */
    border: none;
    border-radius: 6px;
    color: #0f0f0f;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;  
    color: rgb(3, 22, 70);
    align-items: right;
    height: auto; 
    text-align: left;
}

#changePasswordBtn:hover{
   transform: scale(1.05);
}



/*#00000078;*/






@media (max-width: 520px) {
    #inputByUser {
    max-width: 44vw; 
    width: 200px;
    }
    #chat-wrapper {
    min-height: 360px;
    }
    #shopa-header {
    font-size: 2rem;
    }
    .form-box {
     max-width: 90vw;
    }

        #shopa-header {
        font-size: 1rem;
        padding: 0 8px;
    }
    #auth button {
        width: 40px;
        height: 40px;
    }

    #historyToggleBtn {
        font-size: 12px; 
        padding: 4px 8px;
        height: 32px;
    }

    #history-dropdown-wrapper{
        flex-shrink:0;

    }

    #history-dropdown {
        width: min(240px, 90vw);
    }
    }

@media (max-width: 768px) {
    #shopa-header {
        width: 100%; /* Zurück zu normal auf kleinen Screens */
        max-width: 720px;
    }
}







#imageButton {
    padding: 5px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0);
    border: none;
    font-size: 20px;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

#imageButton:hover {
    transform: scale(1.13);
    background: #3f3f3f1d;
}

.image-preview-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding: 8px;
}

.image-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg img.message-image {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 8px;
}    


.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.05);
}

/* Wenn mehrere Bilder */
.message-attachments img:only-child {
    max-width: 100%;
}


/*.msg.user .message-attachments {
    justify-content: flex-end; 
} */







/*history dropdown ab hier: */



#history-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

#historyToggleBtn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  height: 40px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #202020;
  display: none;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
  white-space:nowrap; 
  gap: 6px;
  /*position: relative;*/
}

#historyToggleBtn.visible {
    display: flex;
    gap: 6px; 
    align-items: center; 
}

#historyToggleBtn:hover {
  background: rgba(0, 0, 0, 0.07);
}

#historyToggleBtn .arrow {
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}

#historyToggleBtn.open .arrow {
  transform: rotate(180deg);
}

#history-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  max-height: 360px;
  background: rgba(25, 25, 25, 0.97);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.06) inset;
  z-index: 2000;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

#history-dropdown.open {
  display: flex;
  flex-direction: column;
}

#history-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

#history-list::-webkit-scrollbar { width: 3px; }
#history-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  transition:  0.15s;
}

.history-item:hover {
  background: rgba(255,255,255,0.08);
}

.history-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.history-item-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-edit-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 13px;
  padding: 3px 5px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.history-item:hover .history-edit-btn {
  opacity: 1;
}

.history-edit-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.history-title-input {
  flex: 1;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  padding: 2px 7px;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

#history-footer {
  padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

#historyNewChatBtn {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,0.07);
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  text-align: left;
}

#historyNewChatBtn:hover {
  background: rgba(255,255,255,0.13);
}