
/* Customer Form Modal Styles */
.form-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.form-modal-content {
    background-color: #121212;
    color: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    border: 2px solid #ba4df5;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 25px rgba(186, 77, 245, 0.5);
}

.form-close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #ba4df5;
    cursor: pointer;
    transition: color 0.3s ease;
}

.form-close-button:hover {
    color: #d48eff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ba4df5;
    letter-spacing: 0.5px;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ba4df5;
    background-color: #1a1a1a;
    color: white;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(186, 77, 245, 0.2);
}

.form-group input:focus, 
.form-group textarea:focus {
    border-color: #d48eff;
    box-shadow: 0 0 10px rgba(186, 77, 245, 0.4);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.form-actions button {
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.form-actions button[type="submit"] {
    background-color: #ba4df5;
    color: white;
    box-shadow: 0 4px 10px rgba(186, 77, 245, 0.4);
}

.form-actions button[type="submit"]:hover {
    background-color: #d48eff;
    transform: translateY(-2px);
}

.form-actions button[type="button"] {
    background-color: #333;
    color: white;
}

.required {
    color: #ff6b6b;
}

pre {
  white-space: pre-wrap;       /* Since CSS 2.1 */
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-wrap: break-word;       /* Internet Explorer 5.5+ */
  overflow-wrap: break-word;   /* CSS3 */
  overflow-x: auto;            /* Horizontal scrollbar if needed */
  max-width: 800px;
  width: 90vw;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

body {
  background-image: url("images/BG.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  position: fixed;
}

.icon-container {
    position: fixed;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 90vw;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 20px rgb(255, 255, 255, 0.3);
    z-index: 1000;
}

.icon-container button {
    background-color: transparent;
    border: none;
}

.icon-container i {
    color: #ba4df5; /* Updated purple */
    font-size: 16px;
    cursor: pointer;
}

.icon-container i:hover {
    color: #d48eff; /* Lighter purple on hover */
    font-size: 18px;
    transition: color 0.3s ease;
}

.main-container {
    display: flex;
    flex-direction: column;
    max-width: 350px;
    width: 30%;
    margin-bottom: 100px;
    padding: 20px;
    background-color: #141414;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgb(255, 255, 255, 0.3);
    z-index: 500;
    position: fixed;
    left: 30px;
    top: 80px;
    max-height: 70vh;
    overflow-y: auto;
}

.chat-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #ba4df5;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
}

.chat-close-btn:hover {
    color: #ff0000;
}

@media (max-width: 600px) {
    .main-container {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        max-height: 50vh;
        margin: 0;
        border-radius: 0;
        padding: 15px;
    }
}

/* Conversation Container */
.conversation-container {
    flex: 1;
    overflow-y: auto;
    max-height: calc(70vh - 150px);
    margin-bottom: 20px;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.message {
    margin: 10px 0;
    padding: 12px;
    border-radius: 8px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in-out;
    white-space: pre-wrap;
    position: relative;
}

.message i {
    margin-right: 8px;
}

.user-message i {
    color: #ffffff;
}

.bot-message i {
    color: #ffffff;
}

.message-actions {
    display: none;
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 3px;
    z-index: 5;
}

.bot-message:hover .message-actions {
    display: flex;
}

.message-action-btn {
    background: transparent;
    border: none;
    color: #ba4df5;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    margin: 0 2px;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.message-action-btn:hover {
    color: #ffffff;
    background-color: rgba(186, 77, 245, 0.3);
    transform: scale(1.1);
}

.user-message {
    background-color: #9c30d9;
    align-self: flex-end;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(186, 77, 245, 0.3);
}

.bot-message {
    background-color: #7a20b8;
    align-self: flex-start;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(186, 77, 245, 0.3);
}

/* Input Container */
#input-container {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

/* Input Container */
#input-container button {
     background-color: transparent;
}

/* Input Container */
#input-container i {
    color: #ba4df5; /* Updated purple */
}

#input-container i:hover {
    color: #d48eff; /* Lighter purple on hover */
}
#userInput {
    flex: 1 1 auto;
    max-width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: black;
    color: #ffffff;
    outline: none;
    transition: border 0.2s;
    font-size: 16px;
    box-sizing: border-box;
}

#userInput:focus {
    border-color: #ba4df5;
}

#submitMessage, #connect-button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

#submitMessage {
    background-color: transparent;
    color: #ffffff;
    flex-shrink: 0;
}

#connect-button {
    background-color: transparent;
}

#connect-button.active {
    background-color: #e53935;
}

#connect-button i {
    font-size: 18px;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fullscreen Avatar */
#fullscreen-avatar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    background-color: #000000; /* True black background */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-title {
    color: #ba4df5; /* Match the purple color */
    font-size: 36px;
    text-align: center;
    margin-top: 80px; /* Increased from 30px to position it below the icon container */
    z-index: 20;
    text-shadow: 0 0 10px rgba(186, 77, 245, 0.5); /* Glowing effect */
    background-color: rgba(0, 0, 0, 0.6); /* Transparent background */
    padding: 10px 20px;
    border-radius: 10px;
    display: inline-block;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(186, 77, 245, 0.3);
}

.fullscreen-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Shows the full image without cropping */
    position: absolute;
    top: 0;
    left: 0;
    background-color: #000000; /* True black background */
}

/* For small screens, center and enlarge the avatar image */
@media (max-width: 768px) {
    .fullscreen-avatar-image {
        object-fit: scale-down; /* Better for scaling on small screens */
        max-width: 120%; /* Allow image to be larger */
        max-height: 120%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); /* Center the image */
    }
    
    /* Hide standard GIFs and show transparent GIFs on small screens */
    #avatarGif[src="avatars/supportIdle.gif"] {
        content: url("avatars/supportTransIdle.gif");
    }
    
    #avatarGif[src="avatars/supportActive.gif"] {
        content: url("avatars/supportTransActive.gif");
    }
}

footer {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  z-index: 1000;
}

footer p {
  font-size: 14px;
  color: #ba4df5; /* Updated purple to match the icons */
}

/* Adjusted style for the listening status text */
#listening-status {
    font-size: 14px; /* Reduced font size */
    font-weight: bold;
    display: none; /* Hidden by default */
}

#listening-status.active {
    display: inline-block;
    animation: flash 0.5s infinite; /* Faster animation */
}

@keyframes flash {
    0% { color: lime; }
    25% { color: white; }
    50% { color: orange; }
    75% { color: blue; }
    100% { color: lime; }
}

/* Speak Button Styling */
#speak-button-container {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100; /* Lower z-index so form appears above */
    transition: bottom 0.3s ease;
}

/* Hide speak button when form is active */
.form-modal[style*="display: flex"] ~ #speak-button-container {
    bottom: -100px; /* Move it off-screen when form is visible */
}

#speak-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000000;
    color: #ba4df5;
    border: 2px solid #ba4df5;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(186, 77, 245, 0.3);
}

#speak-button:hover {
    background-color: #1a0029;
    box-shadow: 0 0 15px rgba(186, 77, 245, 0.5);
    transform: scale(1.05);
}

#speak-button.active {
    background-color: #000000;
    color: #ff0000;
    border: 2px solid #ff0000;
    animation: pulse 1.5s infinite;
}

#speak-button i {
    margin-right: 8px;
    font-size: 18px;
}

#speak-status {
    margin-top: 8px;
    font-size: 14px;
    color: #ba4df5;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

#speak-status.active {
    animation: colorCycle 2s infinite;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(186, 77, 245, 0.8);
    letter-spacing: 1px;
}

@keyframes colorCycle {
    0% { color: #ff5252; } /* Red */
    25% { color: #ffeb3b; } /* Yellow */
    50% { color: #69f0ae; } /* Green */
    75% { color: #40c4ff; } /* Blue */
    100% { color: #ff5252; } /* Back to red */
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); }
}

@media (max-width: 480px) {
    .conversation-container {
        max-height: calc(50vh - 100px);
    }

    .icon-container {
        position: fixed;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 90vw;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 4px 20px rgb(255, 255, 255, 0.3);
    }


/* Customer Form Modal Styles */
.form-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.form-modal-content {
    position: relative;
    background-color: #000;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #ba4df5;
    box-shadow: 0 0 30px rgba(186, 77, 245, 0.7);
    color: white;
    animation: modalFade 0.4s ease-in-out;
}

@keyframes modalFade {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-modal h2 {
    text-align: center;
    color: #ba4df5;
    margin-bottom: 25px;
    font-size: 26px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(186, 77, 245, 0.3);
    padding-bottom: 15px;
}

.form-modal h2 i {
    margin-right: 10px;
    font-size: 28px;
}

.form-close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #ba4df5;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.form-close-button:hover {
    color: #ff0000;
    background-color: rgba(255, 0, 0, 0.1);
    transform: scale(1.1);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #ba4df5;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.form-group label i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #444;
    background-color: rgba(20, 20, 20, 0.8);
    color: white;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ba4df5;
    box-shadow: 0 0 5px rgba(186, 77, 245, 0.5);
}

.required {
    color: #ff0000;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #ba4df5;
    box-shadow: 0 0 10px rgba(186, 77, 245, 0.3), inset 0 1px 3px rgba(0, 0, 0, 0.3);
    background-color: rgba(30, 30, 30, 0.9);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

.required {
    color: #ff4d4d;
    font-size: 16px;
    margin-left: 4px;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 35px;
}

.form-actions button {
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-actions button i {
    margin-right: 8px;
}

.form-actions button[type="submit"] {
    background-color: #ba4df5;
    color: white;
    border: none;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(186, 77, 245, 0.4);
}

.form-actions button[type="submit"]:hover {
    background-color: #9c3ad1;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(186, 77, 245, 0.5);
}

.form-actions button[type="button"] {
    background-color: transparent;
    color: #ccc;
    border: 1px solid #444;
    min-width: 120px;
}

.form-actions button[type="button"]:hover {
    background-color: rgba(255, 0, 0, 0.1);
    color: white;
    border-color: rgba(255, 0, 0, 0.3);
}

    #input-container {
        flex-direction: column;
        align-items: flex-start;
    }

    #userInput {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 600px) {
    #input-container {
        flex-direction: column;
        align-items: stretch;
    }
    #submitMessage {
        width: 100%;
    }
}