* {
    font-family: "Geist Pixel", sans-serif;
    font-size: 1rem;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
}

header {
    display: flex;
    justify-content: space-between;
}

.container {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 10px;
    max-width: 500px;
}

.chat-cont {
    border: 1px solid grey;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: 600px;
    box-sizing: border-box;
    padding: 5px;
    background-image: url("./images/bg-light.webp");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.messages-cont {
    display: flex;
    flex-direction: column;
    padding: 5px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.userInput-cont {
    display: flex;
    justify-content: space-around;
    gap: 5px;
    flex-shrink: 0;
}

button {
    cursor: pointer;
    width: fit-content;
    padding: 4px;
    background-color: rgb(9, 159, 9);
    color: #fff;
    border: none;
    border-radius: 8px;
    text-align: center;
}

#sendBtn {
    width: 18%;
    background-color: #E67A93;
}

#sendBtn svg {
    height: 20px;
}


input {
    background-color: #F0F0F0;
    width: 75%;
    border: 2px solid pink;
    border-radius: 10px;
    padding: 10px;
    outline: 2px solid #E67A93;
   
}

.user {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #FEEEF0 ;
  border-radius: 10px;
  max-width: 300px;
 overflow-wrap: break-word;
  word-break: break-word; 
  /* Shrink container to match text size */
  width: fit-content;
}

/*if the user is you, this style may apply*/
.user-you{
  margin-bottom: 15px; 
  background: #E67A93;
  border-radius: 10px;
  max-width: 300px;
  align-self: end;
   display: block; /* Forces the message to start on a new line */
     overflow-wrap: break-word;
  word-break: break-word;    
  /* Shrink container to match text size */
  width: fit-content;   

}

.strong-you {
    color: #fff;
}

.message-you {
    color: #fff;
}


/* Style for the User Name */
.user-name {
  display: block;       /* Forces the message to start on a new line */
  font-size: 14px;
  margin-bottom: 4px;
}



/* Style for the Message */
.user-message {
  margin: 0;
}



/*modal*/
.name-modal {
    position: fixed;
    inset: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;

    display: flex;
    flex-direction: column;
    gap: .5rem;
    
}

#name-input {
    border: none;
    outline: none;
}

#join-btn {
    margin-top: 20px;
    align-self: end;
    padding: 10px;
    text-align: center;
}

button:hover {
    background-color: #047015;
    transition: .3s ease-in;
}


#darkmode-btn {
    cursor: pointer;
    width: 24px;
    height: 24px;
    margin-top: 15px;
}


/*Dark mode*/
.dark-mode {
    background-color: #151C21;
    h2 {
        color: #fff;
    }

    .chat-cont {
    background-image: url("./images/bg-dark.webp");
    }

    input {
    background-color: #F0F0F0;
    width: 75%;
    border: 2px solid #9A8F78;
    color: #041044;
    outline: 2px solid #020E3E  ;
    }
    #sendBtn {
    background-color: #020E3E;
}

.user-you{
    background-color: #0D1F67      ;
}


}



@media (max-width: 600px) {
    body {
        height: 100vh;
        overflow: hidden;
    }

    .container {
        height: 100vh;
        max-width: none;
        box-sizing: border-box;
    }

    .chat-cont {
        flex: 1;
        height: auto;
        max-height: none;
        min-height: 0;
        
        margin: 0;
        padding: 5px;
    }

    .messages-cont {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }
}

