/* Importing Google Fonts for Poppins and Roboto */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,200;1,300;1,400;1,500;1,700;1,900&display=swap');
@import './styleguide.css'; 
/*
  1. Use a more-intuitive box-sizing model.
*/
*, *::before, *::after {
    box-sizing: border-box;
  }
 /*
    2. Remove default margin
  */
  * {
    margin: 0;
  }
  /*
    Typographic tweaks!
    3. Add accessible line-height
    4. Improve text rendering
  */
  body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  /*
    5. Improve media defaults
  */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
  }
  /*
    6. Remove built-in form typography styles
  */
  input, button, textarea, select {
    font: inherit;
  }
  /*
    7. Avoid text overflows
  */
  p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
  }
  /*
    8. Create a root stacking context
  */
  #root, #__next {
    isolation: isolate;
  }
/* Global Styles: Removing default margin and padding, setting box-sizing and font-family */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif; 
}

/* Setting background color for the body */
body {
    background: var(--neutral-0);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

/* Hiding the checkbox input */
input[type="checkbox"] {
    position: absolute;
    left: -9999px;
}

/* Styling the messenger and times labels */
.messenger-label, .times-label {
    position: absolute; 
    right: 30px;  
    bottom: 20px;
    height: 55px; 
    width: 55px; 
    background-color: var(--secondary-600); 
    display: flex;
    justify-content: center;
    align-items: center;  
    border-radius: 50px; 
    font-size: 30px; 
    color: var(--secondary-50);
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.3s ease; /*twist-fade transition */ 
    transform-origin: center; 
}

/* Initial state for times-label: hidden */
.times-label {
    opacity: 0;
    pointer-events: none; 
    transform: rotate(-45deg) scale(0.8); /* Initial state with rotation and scale */
}

.messenger-label {
    opacity: 1;
    transform: rotate(0deg) scale(1); /* Initial state without rotation */
}

/* Changing the state of messenger-label and times-label based on checkbox status */
#click:checked ~ .messenger-label {
    opacity: 0;
    pointer-events: none;
    transform: rotate(45deg) scale(0.8); /* Rotate and shrink out */
    transition: opacity 0.2s ease, transform 0.3s ease; /* Add transition */
}

#click:checked ~ .times-label {
    opacity: 1;
    pointer-events: all;
    transform: rotate(0deg) scale(1); /* Rotate and scale in */
    transition: opacity 0.2s ease, transform 0.3s ease; /* Add transition */
}

.messenger-label:hover, .times-label:hover {
    transform: scale(1.1); /* Slightly enlarge on hover */
}

/*setup the breakpoints! */ 
/* Styling the wrapper (holds and positions chat interface on the screen*/
.wrapper {
    position: absolute;
    right: 30px; 
    bottom: 85px;
    max-width: 400px;
    max-height: 90vh; 
    background: var(--neutral-0);
    border-radius: 30px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    visibility: hidden;
    transition: opacity 0.2s ease; 
    overflow: hidden; /* take off scrollbar at login */ 
}

/* Changing the state of wrapper based on checkbox status */
#click:checked ~ .wrapper {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

#click:not(:checked) ~ .wrapper {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease; /* instant fade-out transition */
}

/* Styling the head-text inside wrapper */
.wrapper .head-text {
    line-height: 60px;
    color: var(--neutral-0);
    border-radius: 15px 15px 0 0; 
    padding: 0px;
    font-weight: 500;
    font-size: 20px;
    background: var(--secondary-600); 
}

/* robert image in login*/
.head-text {
    display: flex;
    align-items: center; 
    position: relative; 
}

.profile-image {
    width: 45px; /* Adjust the size as needed */
    height: 45px; /* Adjust the size as needed */
    left: 5px;
    position: relative;
    margin-right: 25px;
 /* Adjust the spacing as needed */
}

/* Styling the chat-box */
.wrapper .chat-box {
    padding: 30px; 
    width: 100%;
    max-height: calc(90vh - 60px); /* added max-height to limit chat box size */
    overflow-y: auto;
}

/* Styling the description text inside chat-box */
.chat-box .desc-text {
    color: var(--neutral-700); 
    text-align: left;
    line-height: 25px; 
    font-size: 17px; 
    font-weight: 500;
}

/* Styling the form inside chat-box */
.chat-box form {
    padding: 10px 20px;
    margin: 20px 0;
    border-radius: 25px;
    /*border: 1px solid var(--neutral-300); */ 
    transform: translateY(-10px);
}

/* Styling the fields inside the form */
.chat-box form .field {
    height: 50px; 
    width: 300px;
    margin-top: 30px; 
}

/* information icon */
.info-icon {
    font-size: 16px;
    color: var(--neutral-300); 
    cursor: pointer;
    margin-left: 8px;
    position: relative;
    transform: translateY(-20px);
    left: 128px;
    bottom: 28px;
}

.applicable-text {
    color: var(--neutral-300);  /* Change this color to your preferred color */
}

/* CSS for the tooltip */
.tooltip {
    display: none;
    position: absolute;
    top: 274px; /* Adjust position above the icon */
    left: -15px; /* Align with the icon */
    background-color: var(--neutral-300);
    color: var(--neutral-950); 
    text-align: center;
    border-radius: 5px;
    padding: 5px;
    z-index: 1;
    height: 70px;
    width: 330px; /* Reduce the width */
    font-size: 16px; /* Adjust the font size */
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    clip-path: polygon(
        0% 0%, /* top left point */
        100% 0%, /* top right point */
        100% calc(100% - 10px), /* bottom right point */
        calc(55% + 10px) calc(100% - 10px), /* center right of triangle */
        55% 100%, /* tip of triangle */
        calc(55% - 10px) calc(100% - 10px), /* center left of triangle */ 
        0% calc(100% - 10px) /* bottom left point */ 
      );
}

.info-icon:hover + .tooltip {
    display: block;
}

/* Adding margin to the last field */
.chat-box form .field:last-child {
    margin-bottom: 20px;
}


/* Styling inputs, buttons, and textareas inside form */
form .field input,
form .field button,
form .textarea textarea {
    width: 115%;
    height: 100%; 
    padding-left: 20px; 
    border: 1px solid var(--neutral-300); 
    outline: none;
    border-radius: 25px; 
    font-size: 16px; 
    transition: all 0.2s ease; 
}

/* Adding transform to the button inside the field */
form .field button {
    transform: translate(-20px);
}

/* Adjusting input field positioning */
form .field input {
    height: 40px;
    transform: translate(-15px, -20px);
}

#mid { /* adjust MID field */ 
    transform: translate(-15px, -40px);
}

/* Styling the label inside the field */
form .field label {
    display: block;
    margin-bottom: 5px;
    transform: translate(-20px, -20px);
}

/* Changing border color on focus for inputs and textareas */
form .field input:focus, 
form .textarea textarea:focus {
    border-color: var(--secondary-600); 
}

/* Styling placeholders */
form .field input::placeholder,
form .textarea textarea::placeholder {
    color: var(--neutral-400); 
    transition: all 0.2s ease; 
}

/* Changing placeholder color on focus */
form .field input:focus::placeholder,
form .field button:focus::placeholder,
form .textarea textarea:focus::placeholder {
    color: var(--neutral-300); 
}

/* Styling the textarea field */
.chat-box form .textarea {
    height: 70px;
    width: 100%; 
}

/* Styling the textarea inside the form */
.chat-box form .textarea textarea {
    height: 100%;
    border-radius: 50px;
    resize: none;
    padding: 15px 20px; 
    font-size: 16px; 
}
/* checkbox/start chat */
.consent-container {
    display: flex;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 15px;
}

.consent-container input[type="checkbox"] {
    position: static; /* make sure it's not positioned absolutely (make visible) */
    margin-right: 10px;
    accent-color: var(--secondary-600); 
}

.consent-container label {
    font-size: 14px;
}


/* Styling the submit button inside the form */
.field button {
    width: 100%;
    padding: 10px;
    background-color: var(--neutral-300);  /* Initial greyed-out color */
    border: none;
    color: var(--neutral-0); 
    font-size: 16px;
    cursor: not-allowed;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.field button.enabled {
    background-color: var(--secondary-600);  /* Green color when enabled */
    cursor: pointer;
}

.field button:hover.enabled {
    background-color: var(--secondary-700); /* Darker green on hover */
}

/* Messaging container styling */
#chat-container {
    padding: 0px;
    background: linear-gradient(135deg, var(--neutral-0) 0%, var(--neutral-50) 100%);
    border-radius: 30px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    position: absolute;
    right: 30px;
    bottom: 85px;
    max-width: 400px;
    display: none; /* Initially hidden */
    animation: fadeIn 0.2s ease-in-out;
}

/* Keyframes for fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Styling the chat header */
#chat-header {
    display: flex;
    justify-content:  center;
    align-items: center;
    padding: 10px;
    background-color: var(--secondary-600); 
    color: var(--neutral-0); 
    border-radius: 15px 15px 0 0;
}

/* adjust robert in chat */
.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-content .profile-image {
    width: 60px; /* Adjust the size as needed */
    height: 50px; /* Adjust the size as needed */
    margin-right: 10px;
}


/* Styling the close chat button */
#close-chat {
    color: var(--neutral-0); 
    background-color: var(--secondary-600); 
    cursor: pointer;
    padding: 0;
    border: none; 
    font-size: 20px;
}

/* Styling the chat body */
#chat-body {
    padding: 20px;
    height: calc(50vh - 20px); /* Adjust height dynamically */
    width: 100%; /* Adjust width dynamically SET TO PERCENTAGE */ 
    overflow-y: auto;
    position: relative;
}

/* Adding margin to the messages */
#messages {
    margin-bottom: 10px;
}

/* Styling individual messages */
.message {
    margin: 20px 0;
    padding: 10px;
    border-radius: 5px;
    max-width: 70%;
    word-wrap: break-word;
}

/* Styling user messages */
.message.user {
    background-color: var(--secondary-300);
    align-self: flex-end;
    margin-left: auto;
    margin-right: 5px; /* shift chat bubble */ 
}

/* Styling bot messages */
.message.bot {
    background-color: var(--secondary-100);
    align-self: flex-start;
    margin-right: auto;
    margin: 5px;
    
}

/* Styling the chat footer */
#chat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-top: 1px solid var(--neutral-300); 
}

/* Styling the user input textarea */
#user-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--neutral-200); 
    border-radius: 25px; /* Rounded corners */
    margin-right: 10px; 
    font-size: 16px;
    font-family: 'Poppins', sans-serif; /* Modern font */
    resize: none; /* Prevents manual resizing */
    overflow: hidden; /* Hides the scrollbar */
    min-height: 50px; /* Minimum height */
    max-height: 150px; /* Maximum height */
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition */
}

/* Changing border color on focus for user input */
#user-input:focus {
    border-color: var(--secondary-600);  /* Change border color on focus */
    outline: none; /* Remove default outline */
}

/* Styling the send button */
#send-button {
    padding: 10px 20px;
    background-color: var(--secondary-600); 
    color: var(--secondary-50);
    border: none;
    border-radius: 40px;
    cursor: pointer;
}

/* Adding hover effect to the send button */
#send-button:hover {
    background-color: var(--secondary-600); 
}

/* Styling the buttons container */
.buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

/* Styling the selected button */
.buttons-container button.selected {
    background-color: var(--secondary-800); /* Change to a different color when selected */
    color: var(--secondary-50);
}

/* Styling individual buttons */
.buttons-container button {
    background-color: var(--secondary-600);  /* Button background color */
    color: var(--secondary-50); /* Text color */
    border: none; /* Remove border */
    border-radius: 40px; /* Rounded corners */
    padding: 10px 15px; /* Padding inside the button */
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.2s ease; /* Smooth transition for hover effect */
}

/* Adding hover effect for buttons */
.buttons-container button:hover {
    background-color: var(--secondary-600);  /* Darker background color on hover */
    box-shadow: 7px 7px 14px -2px rgba(0,0,0,0.36);
}

/* Adding active effect for buttons */
.buttons-container button:active {
    background-color: var(--secondary-600);  /* Even darker background color on active */
}

/* Custom scrollbar styling */
#chat-body::-webkit-scrollbar {
    width: 10px; /* Width of the scrollbar */
}

#chat-body::-webkit-scrollbar-track {
    background: var(--secondary-50); /* Background of the scrollbar track */
    border-radius: 10px; /* Rounded corners for the track */
}

#chat-body::-webkit-scrollbar-thumb {
    background: var(--secondary-600);  /* Color of the scrollbar thumb */
    border-radius: 10px; /* Rounded corners for the thumb */

}

#chat-body::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-700); /* Color of the thumb on hover */
}

/* feedback form */

.feedback-field {
    margin-bottom: 10px;
    background: var(--secondary-50);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    width: 100%;
}

.feedback-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--neutral-950);
}

.feedback-field textarea,
.feedback-field input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--neutral-300);
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    resize: none;
    box-sizing: border-box;
}

.feedback-field input[type="number"] {
    width: 50px;
}

.feedback-field button {
    padding: 10px 15px;
    background-color: var(--secondary-200);
    color: var(--neutral-950);
    font-weight: medium bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.feedback-field button:hover {
    background-color: var(--secondary-400);
}

/* Feedback Form Specific Adjustments */
#feedback-form .feedback-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#feedback-form .feedback-field textarea {
    height: 80px;
}

#feedback-form .feedback-field input[type="number"] {
    width: 60px;
}

#feedback-form .feedback-field button {
    align-self: flex-end;
    margin-top: 10px;
}

.ces-rating {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.ces-button {
    background-color: var(--neutral-950);
    border-radius: 5px; /* Rounded corners */
    padding: 5px; /* Smaller padding */
    font-size: 0.9em; /* Smaller font size */
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    flex-grow: 1; /* Make buttons grow to fill the space */
    margin: 0px 1px; /* Smaller margin between buttons */
    text-align: center;
    max-width: 40px;
    display: flex;
    justify-content: center; /* center numbers^ */ 
}

.ces-button.selected {
    background-color: var(--secondary-400); /* Darker green when selected */
    border-color: var(--secondary-400); /* Darker border when selected */
}

.ces-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--neutral-800);
    margin-top: 5px;
}

/* NEGATIVE FEEDBACK */
#feedback-form-no {
    margin-bottom: 10px;
    background: var(--secondary-50);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    width: 100%; /* Make it as wide as the chat bubble */
    max-width: none; /* Remove the max-width constraint */
}

.feedback-field-no {
    margin-bottom: 10px;
    width: 100%; /* Ensure the field takes the full width */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.feedback-field-no textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--neutral-300);
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    resize: none;
    box-sizing: border-box;
    height: 80px; /* Specific height for textarea */
}

.feedback-field-no button {
    padding: 10px 15px;
    background-color: var(--secondary-200);
    color: var(--neutral-950);
    font-weight: medium bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
    align-self: center; /* Center the buttons */
    width: 100%; /* Make the buttons full width */
    max-width: 200px; /* Add a max width to the buttons */
}

.feedback-field-no button:hover {
    background-color: var(--secondary-400);
}

/* Hidden inputs (optional if needed for styling) */
.feedback-field-no input[type="hidden"] {
    display: none;
}

/* breakpoints */

/* Breakpoints for devices with a max-width of 480px */
@media (max-width: 480px) {
    .messenger-label, .times-label {
        right: 10px;  
        bottom: 10px;
        height: 45px; 
        width: 45px; 
        font-size: 24px; 
    }
    .wrapper {
        right: 30px; 
        bottom: 70px;
        max-width: 70%;
        max-height: 80vh; 
        border-radius: 15px;
        overflow: auto; /* Allow full overflow for scrolling */
    }
    .wrapper .head-text {
        line-height: 45px;
        font-size: 16px;
    }
    .profile-image {
        width: 45px;
        height: 35px;
    }
    .wrapper .chat-box {
        padding: 15px; 
        max-height: 55vh; /* Ensure the chat-box has enough height */
        overflow-y: auto; /* Enable vertical scrolling */
    }
    .chat-box .desc-text {
        font-size: 14px; 
    }
    .info-icon {
        top: 250px;
    }
    
    form .field input, .field button, .textarea textarea {
        width: 80%; /* Decreased width */
        padding-left: 10px;
        white-space: nowrap;
        border-radius: 15px;
    }

    #mid { /* Adjust MID field */ 
        width: 80%; /* Specific width for the MID field */
        padding-left: 10px; 
        border: 1px solid var(--neutral-300); 
        border-radius: 15px; 
        box-sizing: border-box; 
        margin-top: 20px; 
    }

    .field input {
        transform: translateX(0);
    }
    
    .consent-container {
        display: flex; /* Use flexbox for alignment */
        align-items: center; /* Vertically align items in the center */
        margin-top: 10px; /* Space above the container */
        margin-left: -10px; /* Adjust left margin as needed */
    }
    
    .consent-container input[type="checkbox"] {
        margin-right: 5px; /* Space between the checkbox and label */
    }
    
    .consent-container label {
        font-size: 12px;
        margin: 0; /* Reset default margin for consistent spacing */
    }

    form .field button {
        width: 80%; /* Decreased width */
        padding: 8px;
        font-size: 12px;
        margin-bottom: 0;
    }

    .info-icon, .tooltip {
        display: none;
        visibility: hidden;
    }
    
    /* chat container */
    .header-content {
        position: sticky;
        display: flex;
        align-items: center; /* Align items horizontally */
        padding: 8px;
        box-sizing: border-box; /* Include padding in width calculation */
    }
    
    .header-content .profile-image {
        width: 45px; /* Adjust size as needed */
        height: 45px; /* Adjust size as needed */
    }

    #chat-container {
        position: absolute;
        display: flex;
        right: 30px;
        bottom: 70px;
        max-width: 70%;
        max-height: 65vh;
        width: 100%; /* Ensures the container takes full width */
        flex-direction: column;
        border-radius: 15px;
        overflow: hidden;
    }
    #chat-body {
        height: calc(55vh - 20px);
        width: 100%;
        overflow-y: auto;
        padding-bottom: 100px;
    }
    .message {
        max-width: 90%;
    }
    .message.user {
        margin-right: -10px;
    }
    
    .message.bot {
        margin-left: -10px;
    }
    /* Chat footer */
    #chat-footer {
        display: flex;
        align-items: center;
        position: sticky;
        padding: 8px;
        bottom: 0;
        background: var(--neutral-100); /* Footer background color */
    }

    /* User input styling */
    #user-input {
        flex-grow: 1; /* Allow input to expand */
        padding: 8px;
        font-size: 12px;
        min-height: 35px;
        max-height: 80px;
        margin-right: 8px; /* Space between input and send button */
        border: 1px solid var(--neutral-300);
        border-radius: 15px;
        box-sizing: border-box; /* Include padding in width calculation */
    }

    /* Send button styling */
    #send-button {
        padding: 8px;
        font-size: 12px;
        border: none;
        border-radius: 15px;
        cursor: pointer;
        flex-shrink: 0; /* Prevent shrinking */
        background-color: var(--secondary-600); 
        color: var(--secondary-50);
    }
        
    .buttons-container {
        gap: 5px;
        margin: 5px 0;
    }
    .buttons-container button {
        padding: 5px 8px;
        font-size: 12px;
    }
    .feedback-field, .feedback-field-no {
        padding: 8px;
    }
    .feedback-field textarea, .feedback-field-no textarea {
        height: 50px;
    }
    .feedback-field button, .feedback-field-no button {
        padding: 5px 8px;
        font-size: 12px;
    }
    .ces-button {
        padding: 3px;
        font-size: 0.7em;
    }
    .ces-labels {
        font-size: 0.7em;
    }
    
    #feedback-form-no.message.bot {
        margin-left: -10px;
    }
    
    .feedback-field {
        margin-left: -10px;
    }
}

  