
/* Import Google font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
:root {
  --text-color: #FFFFFF;
  --icon-color: #ACACBE;
  --icon-hover-bg: #5b5e71;
  --placeholder-color: #8e8e93;
  --outgoing-chat-bg: #343541;
  --incoming-chat-bg: #444654;
  --outgoing-chat-border: #343541;
  --incoming-chat-border: #5a5d6f;
}
.light-mode {
  --text-color: #343541;
  --icon-color: #a9a9bc;
  --icon-hover-bg: #f1f1f3;
  --placeholder-color: #6c6c6c;
  --outgoing-chat-bg: #FFFFFF;
  --incoming-chat-bg: #F7F7F8;
  --outgoing-chat-border: #FFFFFF;
  --incoming-chat-border: #D9D9E3;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
body {
  background: var(--outgoing-chat-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Default Text Styling */
.chat-container {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.default-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 90vh;
  padding: 0 10px;
  text-align: center;
  color: var(--text-color);
  margin-top: 100px;
  margin-bottom: 100px;
}
.default-text h1 {
  font-size: 2.3rem;
}
.default-text p {
  font-size: 1.1rem;
}
.swiper-container {
    position: relative !important;
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background-color:var(--incoming-chat-bg);
    z-index: 1 !important;
    transform: none !important;
}
.swiper-slide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}
.swiper-slide img {
    width: 80%;
    max-width: 300px;
    height: auto;
    margin-bottom: 20px;
}
.swiper-slide h2 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 10px;
}
.swiper-slide p {
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.5;
}
.swiper-button-next,
.swiper-button-prev {
    color: var(--icon-color);
    width: 35px;
    height: 35px;
}
.swiper-pagination-bullet {
    background-color: var(--icon-color);
    opacity: 0.8;
    width: 8px;
    height: 8px;
    margin: 0 6px;
    border-radius: 50%;
}
.swiper-pagination-bullet-active {
    background-color: var(--placeholder-color);
    opacity: 1;
    transform: scale(1.2);
}

/* Header container styling */
.header-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 70px;
  background-color: var(--outgoing-chat-bg);
  padding: 20px;
  align-items: center; 
  justify-content: space-between;
  display: flex;
  z-index: 1000;
}

/* Language Dropdown Container */
.language-switch-container {
    position: absolute;
    top: 10px;
    right: 70px; 
    text-align: center;
}
.language-switch-rectangle {
    width: 50px;
    height: 50px;
    background-color: var(--incoming-chat-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}
.language-switch-rectangle .material-symbols-rounded {
    font-size: 28px;
    color: var(--icon-color);
}
.lang-dropdown {
    position: absolute;
    width: 100%;
    height: 100%;
    top:  0px;
    left: 0;
    opacity: 0; 
    cursor: pointer;
}

/* Profile container styling */
.profile-container {
    position: absolute;
    top: 10px;
    right: 10px;
}

.profile-circle {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.profile-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 60px;
    background: var(--incoming-chat-bg);
    border: 1px solid var(--incoming-chat-border);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    z-index: 1001;
}
.profile-dropdown .user-name {
    display: block;
    text-align: center;
    justify-content: center;
    font-size: 0.75rem; 
    margin-top: 5px;
    margin-bottom: 5px;
    color: var(--text-color);
    text-decoration: none;  
}
.profile-dropdown .user-name:hover {
    color: #007bff;
}
.profile-dropdown a.logout-link, 
.profile-dropdown a.settings-link {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between icon and text */
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 5px 10px;
    justify-content: center;
}
.profile-dropdown a.logout-link span, 
.profile-dropdown a.settings-link span {
    font-size: 20px;
    color: var(--icon-color);
    display: flex;
    align-items: center;
}
.profile-dropdown a.logout-link:hover, 
.profile-dropdown a.settings-link:hover {
    color: #007bff;
}
.profile-dropdown a.logout-link:hover span, 
.profile-dropdown a.settings-link:hover span {
    text-decoration: none; /* Prevent underline on icon */
    color: var(--icon-color);
}
.profile-dropdown a.logout-link:hover::after, 
.profile-dropdown a.settings-link:hover::after {
    content: attr(data-text);
    text-decoration: underline;
    display: none;
}
.profile-dropdown.active {
    display: block;
}


/* Settings Modal styling */
.settings-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
}
.settings-modal-content {
    background-color: var(--incoming-chat-bg);
    margin: auto;
    padding: 20px;
    border: 1px solid var(--incoming-chat-border);
    width: 50%;
    max-width: 300px;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: fadeIn 0.3s;
}
.settings-modal-content h2 {
    margin: 0 0 10px;
    text-align: center;
    color: var(--text-color);
    font-size: 1.0rem;
}
.settings-close-button {
    color: var(--text-color);
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
}
.settings-close-button:hover {
    color: #007bff;
}
.settings-modal-content ul {
    padding: 0;
    list-style-type: none; 
}
.settings-modal-content .settings-link, 
.settings-modal-content .theme-link {
    display: flex;
    align-items: center;
    gap: 8px; 
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.75rem;
    padding: 5px 10px;
    justify-content: center;
}
.settings-modal-content .settings-link:hover {
    color: #007bff;
}
.settings-modal-content a.settings-link span,
.settings-modal-content .theme-link span {
    font-size: 20px;
    color: var(--icon-color);
    display: flex;
    align-items: center;
}

/* Guest Auth Buttons (Matching Recommend/Contact List) */
.guest-auth-container {
    position: absolute;
    top: 10px;
    right: 130px;
    display: flex;
    gap: 10px;
}

.auth-button {
    width: 50px;
    height: 50px;
    background-color: var(--incoming-chat-bg);
    border-radius: 8px;
    display: flex;
    flex-direction: column; /* Stack icon and text vertically */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    text-decoration: none; /* Remove underline from links */
    text-align: center;
    padding: 5px;
    box-sizing: border-box;
}

.login-button-icon {
    font-size: 10px; 
    font-weight: bold;
    font-weight: 500;
    color: var(--text-color);
    font-family: 'Roboto', sans-serif; 
    line-height: 1.2;
    word-break: break-word;
    display: inline-block;
}

.signup-button-icon {
    font-size: 10px; 
    font-weight: bold;
    font-weight: 500;
    color: var(--text-color);
    font-family: 'Roboto', sans-serif; 
    line-height: 1.2;
    word-break: break-word;
    display: inline-block;
}



/* Contacts and Recommendations and Refer-Friend List Styling */
.recommended-list-container {
    position: absolute;
    top: 10px;
    left: 10px;
    text-align: center;
}
.contact-list-container {
    position: absolute;
    top: 10px;
    left: 70px;
}
.refer-friend-container {
    position: absolute;
    top: 10px;
    left: 130px;
}
.contact-list-rectangle, 
.recommended-list-rectangle,
.refer-friend-rectangle {
    width: 50px;
    height: 50px;
    background-color: var(--incoming-chat-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    text-align: center;
}
.contact-list-rectangle .material-symbols-rounded, 
.recommended-list-rectangle .material-symbols-rounded {
    font-size: 28px; 
    color: var(--icon-color);
}
.refer-friend-icon {
    font-size: 10px; 
    font-weight: bold;
    font-weight: 500;
    color: var(--text-color);
    font-family: 'Roboto', sans-serif; 
    line-height: 1.2;
    word-break: break-word;
    display: inline-block;
}
.contact-list-dropdown, 
.recommended-list-dropdown,
.refer-friend-dropdown {
    display: none;
    position: absolute;
    top: 60px;
    left: 0px;
    background: var(--incoming-chat-bg);
    border: 1px solid var(--incoming-chat-border);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 10px;
    z-index: 1000;
    min-width: 250px; 
    max-width: 500px; 
    text-align: center;
    justify-content: center;
}
.contact-list-dropdown {
    left: -60px;
}
.refer-friend-dropdown {
    left: -120px;
}
.contact-list-dropdown .contacts-names, 
.recommended-list-dropdown .recommended-users {
    text-align: center;
    font-size: 0.9rem; 
    font-weight: bold;
    margin-bottom: 0px;
    color: var(--text-color);
}
.contact-list-dropdown .contact-name, 
.recommended-list-dropdown .recommended-user-name,
.login-message {
    display: block;
    text-align: center;
    font-size: 14px; 
    margin: 5px 0;
    color: var(--text-color);
    text-decoration: none; 
    padding: 5px; 
    border-radius: 4px;
    transition: background-color 0.3s ease; 
    justify-content: space-between;
}
.contact-list-dropdown .contact-name:hover,
.recommended-list-dropdown .recommended-user-name:hover{
    color: #007bff;
}
.contact-list-dropdown.active, 
.recommended-list-dropdown.active,
.refer-friend-dropdown.active {
    display: inline-block;
}
.recommended-user-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.recommended-list-action-buttons {
    display: flex;
    gap: 2px;
    margin-right: 8px;
}
.recommended-list-action-buttons button {
    width: 26px;
    height: 26px;
    border: 2px solid transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    background-color: var(--incoming-chat-bg); /* Matches dropdown background */
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.recommended-list-action-buttons button:hover {
    transform: scale(1.2);
}
.accept-btn .material-symbols-rounded {
    color: #28a745; /* Green */
    font-size: 18px;
}
.reject-btn .material-symbols-rounded {
    color: #ff4d4f; /* Red */
    font-size: 18px;
}
.notification-badge {
    background-color: red;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: inline-block;
    min-width: 18px; 
    height: 18px;  
    line-height: 18px; 
    text-align: center; 
    padding: 0 5px;
    font-weight: bold;
}
.refer-friend-form-group {
    margin-bottom: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.refer-friend-form-group label {
    display: block;
    color: var(--text-color);
}
.refer-friend-form-group input {
    width: 95%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: var(--outgoing-chat-bg);
}
.refer-friend-form-group button {
    width: 30%;
    padding: 5px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.refer-friend-form-group button:hover {
    background-color: #0056b3;
}
.refer-friend-form-group p {
    font-size: 0.75em;
    color: var(--text-color);
    text-align: center;
    margin: 5px 0;
    padding: 5px 0;
}
.refer-friend-form-group .spinner {
    justify-content: center;
    align-items: center;
    width: 100%;
    font-size: 0.75em;
    color: var(--text-color);
    text-align: center;
    margin: 5px 0;
    padding: 5px 0;
    gap: 5px;
}
.spinner::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Chats container styling */
.chat-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  margin-top: 100px;
  margin-bottom: 100px;
  width: 100vw;
  align-items: center;
}
:where(.chat-container, textarea)::-webkit-scrollbar {
  width: 6px;
}
:where(.chat-container, textarea)::-webkit-scrollbar-track {
  background: var(--incoming-chat-bg);
  border-radius: 25px;
}
:where(.chat-container, textarea)::-webkit-scrollbar-thumb {
  background: var(--icon-color);
  border-radius: 25px;
}
.date-separator {
  text-align: center;
  margin: 10px 0;
  font-size: 0.9rem;
  opacity: 0.7;
  color: var(--text-color);
}
.chat {
  padding: 10px 25px 40px 15px;
  border-radius: 20px;
  position: relative;
  word-wrap: break-word;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  width: fit-content;
  min-width: 10%;
  font-size: 18px;
}
.chat.outgoing {
  max-width: 70%;
  background: var(--incoming-chat-bg);
  border: 1px solid var(--incoming-chat-border);
  color: var(--text-color);
  border-bottom-right-radius: 5px;
  align-self: flex-end;
  justify-content: flex-end;
}
.chat.incoming {
  max-width: 85%;
  background:  var(--outgoing-chat-bg);
  border: 1px solid var(--incoming-chat-border);
  color: var(--text-color);
  align-items: center;
  gap: 10px;
  border-bottom-left-radius: 5px;
  align-self: flex-start
  justify-content: flex-start;
}

.chat-time {
  font-size: 10px;
  margin-top: 10px;
  color: var(--text-color);
  opacity: 0.7;
  position: absolute;
  right: 20px;
  bottom: 10px;
}
.chat img {
  width: 35px;
  height: 35px;
  align-self: flex-start;
  object-fit: cover;
  border-radius: 50%;
}
.chat p {
  white-space: pre-wrap;
  font-size: 1.05rem;
  color: var(--text-color);
  word-break: break-word;
}
.chat-container p.error {
  color: #e55865;
}
.chat .typing-animation {
  display: flex;
  align-items: center;
}
.typing-animation .typing-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  margin: 0 3px;
  opacity: 0.7;
  background: var(--text-color);
  animation: animateDots 1.5s var(--delay) ease-in-out infinite;
}
.typing-animation .typing-dot:first-child {
  margin-left: 0;
}
@keyframes animateDots {
  0%,44% {
    transform: translateY(0px);
  }
  28% {
    opacity: 0.4;
    transform: translateY(-6px);
  }
  44% {
    opacity: 0.2;
  }
}


/* Typing container styling */
.typing-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  padding: 20px 10px;
  justify-content: center;
  background: var(--outgoing-chat-bg);
  border-top: 1px solid var(--incoming-chat-border);
  z-index: 1;
}
.typing-container .typing-content {
  display: flex;
  max-width: 950px;
  width: 100%;
  align-items: flex-end;
}
.typing-container .typing-textarea {
  width: 100%;
  display: flex;
  position: relative;
}
.typing-textarea textarea {
  resize: none;
  height: 55px;
  width: 100%;
  border: none;
  padding: 15px 45px 15px 20px;
  color: var(--text-color);
  font-size: 1rem;
  border-radius: 4px;
  max-height: 250px;
  overflow-y: hidden;
  background: var(--incoming-chat-bg);
  outline: 1px solid var(--incoming-chat-border);
  direction: ltr; 
  text-align: left;
  vertical-align: middle;
}
.typing-textarea textarea.rtl {
  direction: rtl;
  text-align: right;
}
.typing-textarea textarea::placeholder {
  color: var(--placeholder-color);
  vertical-align: middle;
}
.typing-content span {
  width: 55px;
  height: 55px;
  display: flex;
  border-radius: 4px;
  font-size: 1.35rem;
  align-items: center;
  justify-content: center;
  color: var(--icon-color);
}
.typing-textarea span {
  position: absolute;
  right: 0;
  bottom: 0;
  visibility: hidden;
}
.typing-textarea textarea:valid ~ span {
  visibility: visible;
}
.typing-controls {
  display: flex;
}
.typing-controls span {
  margin-left: 7px;
  font-size: 1.4rem;
  background: var(--incoming-chat-bg);
  outline: 1px solid var(--incoming-chat-border);
}
.typing-controls span:hover {
  background: var(--icon-hover-bg);
}


/* Enhanced Responsive Media Query */
@media screen and (max-width: 600px) {    
    .chat-container {      
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .chat-container::-webkit-scrollbar {
        display: none;
    }
    .chat-history {
        margin-top: 70px;
        width: 95vw;
        padding-bottom: 50px;
    }
    .chat {
        min-width: 20%;
    }
    .typing-container {
        width: 95vw;
        padding: 20px 10px;
    }
}

