/*************** 
 * BASE STYLES *
 ***************/

/* Overwrite browser defaults */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

html {
  font-size: 62.5%;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Variables */
:root {
  --background-green: #19203c;
  --background-beige: #f3f7f9;
  --sidebar-header: #ededed;
  --notifications-text-color: rgba(48, 48, 48, 0.96);
  --notifications-link-color: rgba(48, 48, 48, 0.85);
  --notifications-background-color: #9de1fe;
  --search-bar-bg: #f6f6f6;
  --white: #ffffff;
  --text-gray: #919191;
  --chat-border: #ededed;
  --whatsapp-green: #3ccc2f;
  --scrollbar-color: #cccccc;
  --chat-window-scrollbar-color: #bab3ae;
  --box-shadow-color: #d5d5d5;
  --chat-hover-color: #f5f5f5;
  --chat-active-color: #ebebeb;
  --chat-window-beige: #e5ddd5;
  --sender-message-green: #dcf8c6;
  --type-message-bar: #f0f0f0;
}

/************* 
 * MAIN GRID *
 *************/
.grid {
  display: grid;
  height: 100%;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 12.8rem 1fr;
}

/****************** 
 * APP BACKGROUND *
 ******************/
.top {
  background: var(--background-green);
  grid-column: 1 / -1;
  grid-row: 1 / 2;
}

.bottom {
  background: var(--background-beige);
  grid-column: 1 /-1;
  grid-row: 2 / -1;
}

/*******
 * APP *
 *******/

.app {
  display: grid;
  grid-template-columns: 42rem 1fr;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  width: 139.6rem;
  margin: 2rem auto;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 0 1rem 0.05rem rgba(0, 0, 0, 0.2);
}

/***********
 * SIDEBAR *
 ***********/
.sidebar {
  grid-column: 1 / 2;
  background: var(--white);
  border-right: 1px solid rgba(0, 0, 0, 0.2);
}

.sidebar-header {
  background: var(--sidebar-header);
  display: flex;
  justify-content: space-between;
  height: 6rem;
  padding: 1rem 2rem;
}

/* Profile image */
.sidebar-header .profile > img {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  cursor: pointer;
}

.sidebar-header-icons {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.sidebar-header-icons img {
  cursor: pointer;
}

.sidebar-header-icons img:active,
.chat-window-menu-icon:active {
  background: var(--box-shadow-color);
  border-radius: 50%;
  box-shadow: 0 0 1px 8px var(--box-shadow-color);
}

/* Selects the icon in the center */
.sidebar-header-icons img:nth-child(2) {
  margin: 0 1rem;
}


.sidebar-header-icons-chat {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  margin-left: 10px;
}

.sidebar-header-icons-chat img {
  cursor: pointer;
}

.sidebar-header-icons-chat img:active,
.chat-window-menu-icon:active {
  background: var(--box-shadow-color);
  border-radius: 50%;
  box-shadow: 0 0 1px 8px var(--box-shadow-color);
}

/* Selects the icon in the center */
.sidebar-header-icons-chat img:nth-child(2) {
  margin: 0 1rem;
}

/* Sidebar notifications */
.sidebar-notifications {
  display: flex;
  align-items: center;
  background: var(--notifications-background-color);
  height: 9rem;
  padding: 0 2rem;
  cursor: pointer;
}

.sidebar-notifications > img {
  margin-right: 2rem;
}

.sidebar-notifications-message {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-notifications-message span {
  font-size: 1.6rem;
  color: var(--notifications-text-color);
}

.sidebar-notifications-message a {
  font-size: 1.4rem;
  color: var(--notifications-link-color);
}

.sidebar-notifications-message img {
  vertical-align: middle;
}

.sidebar-notifications-message a:hover {
  text-decoration: underline;
}

/* Search chat */
.search-chat {
  background: var(--search-bar-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.search-bar {
  display: flex;
  padding: 1rem;
  border-bottom: 1px solid var(--chat-border);
}

/* Selects the search icon */
.search-bar > img {
  width: 2.8rem;
  background: var(--white);
  border-top-left-radius: 2rem;
  border-bottom-left-radius: 2rem;
  padding-left: 1rem;
}

/* Search input */
.search-bar input {
  outline: none;
  border: none;
  padding: 1rem 1rem 1rem 2rem;
  flex: 1;
  border-top-right-radius: 2rem;
  border-bottom-right-radius: 2rem;
  font-family: "Segoe UI";
}

.search-bar input::placeholder {
  color: var(--text-gray);
}

/* Chats */
.chats {
  height: calc(100vh - 14rem);
  overflow-y: scroll;
  overflow-x: hidden;
}

/* Change scrollbar style */
.chats::-webkit-scrollbar {
  width: 0.7rem;
  height: 3rem;
}

.chats::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-color);
}

.chat {
  display: flex;
  align-items: center;
  background: var(--white);
  padding: 1rem 0 0 2rem;
  cursor: pointer;
}

.chat:hover {
  background: var(--chat-hover-color);
}

.chat:hover .chat-options {
  display: initial;
}

.active-chat {
  background: var(--chat-active-color) !important;
}

/* Contact image */
.chat-left img {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
}

.chat-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: 1.5rem;
  padding-right: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--chat-border);
}

/* Remove border bottom from the last chat */
.chat:last-of-type .chat-right {
  border-bottom: none;
}

.chat-right-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.contact-name {
  font-size: 1.7rem;
}

.chat-message,
.chat-message-typing,
.chat-message-group {
  font-size: 1.5rem;
}

.chat-message,
.chat-message-group {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28rem;
}

.chat-message {
  color: var(--text-gray);
}

.chat-message-group {
  font-weight: 500;
  color: inherit;
}

.chat-message-typing {
  color: var(--whatsapp-green);
  font-weight: 500;
}

.chat-date {
  font-size: 1.2rem;
  color: var(--text-gray);
}

.chat-right-bottom {
  display: flex;
}

.chat-right-bottom-left {
  display: flex;
  align-items: flex-end;
  flex: 1;
}

.chat-right-bottom-right {
  display: flex;
  align-items: center;
}

.unread-messages-number {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  background: var(--whatsapp-green);
  color: var(--white);
  font-weight: 500;
  border-radius: 50%;
  text-align: center;
  line-height: 2rem;
}

.chat-options {
  display: none;
  margin-left: 0.5rem;
}

.chat-options img {
  vertical-align: middle;
}

.single-check-mark,
.double-check-mark {
  margin-right: 0.2rem;
}

.single-check-mark {
  width: 1.4rem;
}

.double-check-mark {
  width: 2rem;
}

.image-icon,
.microphone-icon {
  margin-right: 0.3rem;
}

/********
 * MAIN *
 ********/
.main {
  grid-column: 2 / -1;
  background: var(--chat-window-beige);
  position: relative;
}

.chat-window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 6rem;
  padding: 1rem 2rem;
  background: var(--sidebar-header);
  cursor: pointer;
}

.chat-window-header-left {
  display: flex;
  align-items: center;
}

.contact-name-and-status-container {
  display: flex;
  flex-direction: column;
}

.chat-window-contact-image {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  cursor: pointer;
  margin-right: 1.5rem;
}

.chat-window-contact-name {
  font-size: 1.7rem;
}

.chat-window-contact-status {
  color: var(--text-gray);
  font-size: 1.3rem;
}

.chat-window-menu-icon {
  margin-left: 2rem;
}

/* Chat window */

.chat-window {
  display: flex;
  flex-direction: column;
  padding: 10rem 10rem 6rem 10rem;
  height: calc(100vh - 8rem);
  overflow: scroll;
  overflow-x: hidden;
  background-repeat: repeat;
  flex-direction: column-reverse;
}

.chat-window::-webkit-scrollbar {
  width: 0.7rem;
  height: 3rem;
}

.chat-window::-webkit-scrollbar-track {
  background: var(--chat-window-beige);
}

.chat-window::-webkit-scrollbar-thumb {
  background-color: var(--chat-window-scrollbar-color);
}

.sender,
.receiver {
  border-radius: 0.5rem;
  padding: 0.8rem 1rem;
  margin-bottom: 0.3rem;
  position: relative;
}

.sender {
  background: var(--sender-message-green);
  align-self: flex-end;
}

.receiver {
  background: var(--white);
  align-self: flex-start;
}

.sender-message,
.receiver-message {
  font-size: 1.4rem;
  margin-right: 3rem;
}

.message-time,
.audio-message-length {
  color: var(--text-gray);
  font-size: 1.08rem;
}

.message-status img {
  vertical-align: bottom;
}

.image-message {
  width: 33rem;
  height: 33rem;
  position: relative;
  padding: 0.5rem;
  cursor: pointer;
}

.image-message img {
  width: 100%;
  height: 100%;
}

.image-message .receiver-message {
  margin-right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-message .message-time {
  position: absolute;
  bottom: 1rem;
  right: 2rem;
  color: var(--white);
}

.receiver-message-tail,
.sender-message-tail {
  width: 0.8rem;
  height: 1.3rem;
  position: absolute;
  top: 0;
}

.receiver-message-tail {
  left: -0.5rem;
}

.sender-message-tail {
  right: -0.5rem;
}

.receiver-audio-message {
  width: 33rem;
}

.audio-message {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.audio-message-left {
  cursor: pointer;
}

.audio-message-center {
  position: relative;
  margin: 0 1.5rem;
  flex: 1;
}

/* Reset input range styles */
input[type="range"]:focus {
  outline: none;
}

/* Special styling for WebKit/Blink */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  background: #30b6f6;
  cursor: pointer;
  height: 1.5rem;
  width: 1.5rem;
  border-radius: 50%;
}

input[type="range"] {
  background: #d8d8d8;
  width: 100%;
  height: 0.5rem;
  -webkit-appearance: none;
  border-radius: 10px;
}

.audio-message-bar {
  width: 75%;
  background: #30b6f6;
  position: absolute;
  left: 0;
  height: 0.5rem;
  z-index: 1;
}

.audio-message-center-top {
  display: flex;
}

.audio-message-center-bottom {
  position: absolute;
  top: 1.5rem;
  width: 100%;
}

.audio-message-bottom {
  display: flex;
  justify-content: space-between;
}

.audio-message-right {
  position: relative;
}

.audio-message-contact-image {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
}

.audio-message-microphone {
  width: 2rem;
  position: absolute;
  bottom: 0;
  left: -1rem;
}

.type-message-bar {
  position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  background: var(--type-message-bar);
  padding: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
}

.type-message-bar img {
  cursor: pointer;
}

.type-message-bar-left img:nth-of-type(2) {
  margin: 0 2rem;
}

.type-message-bar-center {
  flex: 1;
}

.type-message-bar-center input {
  width: 100%;
  outline: none;
  border: none;
  padding: 1rem 1rem 1rem 2rem;
  flex: 1;
  border-radius: 2rem;
  font-family: "Segoe UI";
}

.type-message-bar-center input::-webkit-input-placeholder {
  font-size: 1.5rem;
}

.type-message-bar-right {
  margin-left: 2rem;
}

/* Pop-up temel stilleri */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  padding: 20px;
  background-color: white;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
}

/* Pop-up görünürken */
.popup.active {
  opacity: 1;
  visibility: visible;
}

/* Kapatma butonu */
.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  cursor: pointer;
  color: #333;
}

/* Sayfanın kararması için arka plan */
.hidden {
  display: none;
}

/* Sayfa kararması */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}
.sidebar-header .profile {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

/* login */ 

/* Ana Container */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f1f1f1;
}

/* Login Box */
.login-box {
  background-color: #fff;
  padding: 40px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  width: 90vh;
  text-align: center;
}

/* Başlık */
.login-box h2 {
  margin-bottom: 30px;
  font-size: 24px;
  color: #333;
}

/* Input Grubu */
.input-group {
  margin-bottom: 20px;
  text-align: left;
  width: 100%;
}

.input-group label {
  font-weight: bold;
  color: #333;
}

.input-group input {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

.input-group input:focus {
  outline: none;
  border-color: #007bff;
}

/* Giriş Yap Butonu */
.login-container .btn {
  width: 100%;
  padding: 10px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}

.login-container .btn:hover {
  background-color: #0056b3;
}

/* Unutulmuş Şifre Linki */
.forgot-password {
  margin-top: 15px;
}

.forgot-password a {
  color: #007bff;
  text-decoration: none;
}

.forgot-password a:hover {
  text-decoration: underline;
}

#notification {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ffcc00;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
}