/* ================================================================= */
/* SECRET CHAT ROOM STİLLERİ */
/* ================================================================= */

.chatroom-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* Chat Telefon Kabuğu */
.chat-phone {
  width: 100%;
  max-width: 400px;
  height: 600px;
  background: #ffffff;
  border-radius: 35px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
  border: 10px solid #2f3640; /* Telefon çerçevesi */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  font-family: 'Outfit', sans-serif;
}

/* Chat Header */
.chat-header {
  background: #075e54;
  color: white;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.chat-back-arrow {
  font-size: 18px;
  cursor: pointer;
  opacity: 0.9;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.3);
  background: #ffd1dc;
}

.chat-user-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.chat-username {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.chat-status {
  font-size: 10px;
  opacity: 0.85;
}

/* Chat Body (Mesajların Listelendiği Alan) */
.chat-body {
  flex-grow: 1;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0,0,0,0.03) 1px, transparent 0),
                    radial-gradient(rgba(0,0,0,0.03) 1px, transparent 0);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.chat-body::-webkit-scrollbar {
  width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* Chat Mesaj Balonları */
.chat-bubble {
  max-width: 75%;
  min-width: 65px;
  padding: 8px 36px 16px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  animation: messageSlideIn 0.3s ease;
}

/* Sağdaki Balon (Gönderen) */
.chat-bubble.right-bubble {
  align-self: flex-end;
  background: #d9fdd3;
  color: #111a24;
  border-top-right-radius: 0;
}

/* Soldaki Balon (Alıcı) */
.chat-bubble.left-bubble {
  align-self: flex-start;
  background: #ffffff;
  color: #333333;
  border-top-left-radius: 0;
}

/* Mesaj Saati */
.chat-meta {
  position: absolute;
  bottom: 2px;
  right: 6px;
  font-size: 8.5px;
  color: #8696a0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.chat-bubble.right-bubble .chat-meta {
  color: #53bdeb; /* Çift mavi tik */
}

/* Alt Mesaj Gönderme Alanı (Input Footer) */
.chat-footer {
  background: #f0f2f5;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-top: 1px solid rgba(0,0,0,0.05);
  pointer-events: auto !important;
}

.chat-input {
  flex-grow: 1;
  background: white;
  border: none;
  height: 36px;
  border-radius: 18px;
  padding: 0 16px;
  font-size: 13.5px;
  color: #333;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  outline: none;
  pointer-events: auto !important;
  user-select: text !important;
  -webkit-user-select: text !important;
}

.chat-input::placeholder {
  color: #999;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #00a884;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: background 0.2s ease, transform 0.1s ease;
}

.chat-send-btn:hover {
  background: #008f72;
}

.chat-send-btn:active {
  transform: scale(0.95);
}

.chat-attach-btn, .chat-mic-btn, .chat-send-btn {
  pointer-events: auto !important;
  cursor: pointer;
}

@keyframes messageSlideIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Media Attachments */
.chat-image-attachment {
  width: 100%;
  max-width: 250px;
  border-radius: 8px;
  margin-top: 4px;
  cursor: zoom-in;
  display: block;
  transition: transform 0.2s ease;
}

.chat-image-attachment:hover {
  transform: scale(1.02);
}

.chat-audio-attachment {
  width: 100%;
  min-width: 220px;
  margin-top: 5px;
  outline: none;
}

.chat-file-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.04);
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 4px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(0,0,0,0.08);
}

.chat-file-icon {
  font-size: 24px;
}

.chat-file-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-file-name {
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.chat-file-download-text {
  font-size: 10px;
  color: #00a884;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.3s ease;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-modal.active .lightbox-img {
  transform: scale(1);
}

/* Loading Spinner */
.chat-loading-spinner {
  align-self: center;
  font-size: 11px;
  color: #8696a0;
  background: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
  animation: pulse 1.5s infinite;
}

/* Audio Recording Indicator */
.recording-mic {
  animation: recordingPulse 1s infinite alternate;
}

@keyframes recordingPulse {
  0% { transform: scale(1); color: #00a884; }
  100% { transform: scale(1.15); color: #ea4335; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blink {
  0% { opacity: 0.2; }
  100% { opacity: 1; }
}

/* ================================================================= */
/* ARAMA VE GÖRÜNTÜLÜ KONUŞMA STİLLERİ (CALL OVERLAYS) */
/* ================================================================= */

.chat-call-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111b21;
  color: white;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 40px 20px;
  box-sizing: border-box;
  animation: fadeIn 0.4s ease;
}

.chat-call-overlay.active {
  display: flex;
}

/* Bulanık Arka Plan */
.call-bg-blur {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(25px) brightness(0.3);
  z-index: -1;
  opacity: 0.75;
}

.call-info-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  text-align: center;
}

.call-avatar-pulsing {
  position: relative;
  width: 100px;
  height: 100px;
}

.call-avatar-pulsing img, .call-avatar-pulsing .fallback-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}

.call-avatar-pulsing::before, .call-avatar-pulsing::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 2px solid var(--rose-pink);
  opacity: 0;
  animation: callPulse 2s infinite ease-out;
}

.call-avatar-pulsing::after {
  animation-delay: 1s;
}

.call-name {
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.call-status-text {
  font-size: 13px;
  color: #a0aab2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Arama Butonları */
.call-btn-group {
  display: flex;
  justify-content: center;
  gap: 40px;
  width: 100%;
  margin-bottom: 20px;
}

.call-btn-circle {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.call-btn-circle:hover {
  transform: scale(1.1);
}

.call-btn-decline {
  background: #ea4335; /* Kırmızı kapatma */
}

.call-btn-accept {
  background: #00a884; /* Yeşil açma */
  animation: shakeBtn 1.5s infinite;
}

/* Kameranın Aktif Olduğu Görünüm (Connected Video Call) */
.call-video-active-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: none;
  flex-direction: column;
  z-index: 11;
  overflow: hidden;
}

.call-video-active-panel.active {
  display: flex;
}

.call-video-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Ayna görüntüsü */
}

/* Köşedeki Küçük Kamera Önizlemesi */
.call-video-pip {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 90px;
  height: 135px;
  background: #222;
  border-radius: 8px;
  border: 1.5px solid white;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  z-index: 12;
}

.call-video-pip-stream {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* Görüşme İçi Kontroller (Alt Kısım) */
.call-active-footer {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 25px;
  z-index: 13;
}

.call-btn-mute {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.call-btn-mute.muted {
  background: #ea4335;
}

@keyframes callPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes shakeBtn {
  0% { transform: scale(1); }
  10% { transform: scale(1.1) rotate(-5deg); }
  20% { transform: scale(1.1) rotate(5deg); }
  30% { transform: scale(1.1) rotate(-5deg); }
  40% { transform: scale(1.1) rotate(5deg); }
  50% { transform: scale(1); }
  100% { transform: scale(1); }
}
