/* ============================================
   WEBTY CANLI DESTEK PANELİ - MODERN TASARIM
   v4.3 - Tam Ekran, Scroll'suz, Gelişmiş UI
   ============================================ */

/* ===== WORDPRESS ADMIN BAR GİZLE ===== */
#wpadminbar {
  display: none !important;
}
html {
  margin-top: 0 !important;
}
body.admin-bar {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ===== SAYFA SCROLL'UNU TAMAMEN KAPAT ===== */
html, body {
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* WordPress tema boşluklarını sıfırla */
.site-header,
.entry-header,
.page-header,
#masthead,
.wp-site-blocks > header,
.entry-content,
.site-footer,
#colophon,
.footer-widgets {
  margin: 0 !important;
  padding: 0 !important;
}
body.page .site-footer,
body.page #colophon,
body.page .footer-widgets {
  display: none !important;
}

/* ===== GENEL WRAPPER - Tam Ekran ===== */
.slc-support-wrap { 
  width: 100vw;
  height: 100vh;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: #f0f2f5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
}

/* ===== HEADER ===== */
.slc-support-header {
  background: linear-gradient(135deg, #201F5A 0%, #F26228 100%);
  color: white;
  padding: 0 24px;
  height: 52px;
  box-sizing: border-box;
  box-shadow: 0 2px 12px rgba(32, 31, 90, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 100;
}

.slc-support-header > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.slc-support-header h1,
.slc-support-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}

.slc-support-sub {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 400;
}

/* Çıkış Butonu */
.slc-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.slc-logout-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  color: white;
  text-decoration: none;
}

/* ===== GRID LAYOUT ===== */
.slc-support-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  padding: 0;
  flex: 1;
  height: calc(100vh - 52px);
  max-height: calc(100vh - 52px);
  overflow: hidden;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* ===== SOL PANEL ===== */
.slc-support-left {
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid #e4e6ea;
}

.slc-support-title {
  background: #201F5A;
  color: white;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  text-transform: uppercase;
}

/* Sohbet Listesi */
.slc-session-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
  background: #fafbfc;
}

.slc-session-list::-webkit-scrollbar { width: 5px; }
.slc-session-list::-webkit-scrollbar-track { background: transparent; }
.slc-session-list::-webkit-scrollbar-thumb {
  background: #c4c8cc;
  border-radius: 3px;
}
.slc-session-list::-webkit-scrollbar-thumb:hover { background: #a0a4a8; }

/* ===== SOHBET KARTLARI ===== */
.slc-session-item {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.slc-session-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: transparent;
  transition: background 0.2s;
}

.slc-session-item:hover {
  background: #f8f9ff;
  border-color: #c8c7e8;
}

.slc-session-item:hover::before {
  background: #F26228;
}

.slc-session-item.active {
  background: #f3f2ff;
  border-color: #201F5A;
  box-shadow: 0 2px 8px rgba(32, 31, 90, 0.1);
}

.slc-session-item.active::before {
  background: #F26228;
}

.slc-session-item.closed {
  opacity: 0.55;
  background: #f8f9fa;
}
.slc-session-item.closed:hover {
  opacity: 0.75;
}

.slc-session-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.slc-session-id {
  font-weight: 600;
  color: #201F5A;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.slc-session-id::before {
  content: '👤';
  font-size: 14px;
}

/* Badge */
.slc-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}

.slc-badge.waiting {
  background: #fff3cd;
  color: #856404;
}
.slc-badge.active {
  background: #d4edda;
  color: #155724;
}
.slc-badge.closed {
  background: #f0f0f0;
  color: #888;
}

.slc-session-meta {
  font-size: 11px;
  color: #999;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.slc-session-meta::before {
  content: '🕐';
  font-size: 11px;
}

/* Butonlar */
.slc-session-item button {
  width: 100%;
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slc-claim {
  background: #ffc107;
  color: #000;
}
.slc-claim:hover {
  background: #ffca2c;
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.35);
}

.slc-open {
  background: #28a745;
  color: white;
}
.slc-open:hover {
  background: #2dbe4e;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.35);
}

.slc-open-closed {
  background: #6c757d;
  color: white;
}
.slc-open-closed:hover {
  background: #7b848c;
}

/* ===== SAĞ PANEL - SOHBET ALANI ===== */
.slc-support-right {
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.slc-support-right .slc-support-title {
  background: linear-gradient(135deg, #201F5A 0%, #F26228 100%);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  text-transform: none;
  font-size: 14px;
}

.slc-support-right .slc-support-title > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Müşteri Bilgileri */
.slc-customer-info {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.slc-info-email,
.slc-info-phone {
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.slc-info-email:hover,
.slc-info-phone:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Timer */
#slc-chat-timer {
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Aksiyon Butonları */
#slc-quick-replies-btn,
#slc-end-chat,
#slc-clear-all-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#slc-quick-replies-btn {
  background: rgba(40, 167, 69, 0.9);
  color: white;
}
#slc-quick-replies-btn:hover {
  background: #28a745;
}

#slc-end-chat {
  background: rgba(220, 53, 69, 0.9);
  color: white;
}
#slc-end-chat:hover {
  background: #dc3545;
}

#slc-clear-all-btn {
  background: rgba(108, 117, 125, 0.85);
  color: white;
}
#slc-clear-all-btn:hover {
  background: #6c757d;
}

/* ===== CHAT BOX ===== */
.slc-chat-box {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  background: #f7f8fa;
  scroll-behavior: smooth;
}

.slc-chat-box::-webkit-scrollbar { width: 6px; }
.slc-chat-box::-webkit-scrollbar-track { background: transparent; }
.slc-chat-box::-webkit-scrollbar-thumb {
  background: #c4c8cc;
  border-radius: 3px;
}

/* ===== MESAJLAR ===== */
.slc-msg {
  margin-bottom: 10px;
  animation: msgIn 0.25s ease;
}

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

.slc-msg.user { text-align: left; }
.slc-msg.agent { text-align: right; }
.slc-msg.system { text-align: center; }

.slc-bubble {
  display: inline-block;
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
}

.slc-msg.user .slc-bubble {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #e0e3e7;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.slc-msg.agent .slc-bubble {
  background: linear-gradient(135deg, #201F5A, #302f7a);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 6px rgba(32, 31, 90, 0.15);
}

.slc-msg.system .slc-bubble {
  background: #ffeeba;
  color: #856404;
  font-weight: 600;
  border-radius: 16px;
  font-size: 12px;
  padding: 6px 14px;
}

/* ===== CHAT INPUT ===== */
.slc-chat-input {
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid #e4e6ea;
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

#slc-agent-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #dde0e4;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
  background: #f8f9fa;
}
#slc-agent-input:focus {
  outline: none;
  border-color: #F26228;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(242, 98, 40, 0.08);
}
#slc-agent-input:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
  opacity: 0.5;
}

#slc-agent-send {
  padding: 10px 20px;
  background: linear-gradient(135deg, #201F5A, #F26228);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
#slc-agent-send:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(242, 98, 40, 0.3);
  transform: translateY(-1px);
}
#slc-agent-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Sohbet Kapat Alt Buton */
#slc-end-chat-bottom {
  padding: 10px 14px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
#slc-end-chat-bottom:hover:not(:disabled) {
  background: #c82333;
}
#slc-end-chat-bottom:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== HIZLI CEVAPLAR ===== */
.slc-quick-menu {
  position: absolute;
  bottom: 56px;
  left: 16px;
  right: 16px;
  background: #fff;
  border: 1px solid #e4e6ea;
  border-radius: 10px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  animation: menuUp 0.2s ease;
}

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

.slc-quick-reply-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.15s;
  font-size: 13px;
  color: #333;
}
.slc-quick-reply-item:last-child { border-bottom: none; }
.slc-quick-reply-item:hover {
  background: #f3f2ff;
  color: #201F5A;
  padding-left: 18px;
}

/* Empty State */
.slc-empty {
  padding: 40px 16px;
  text-align: center;
  color: #999;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.slc-empty::before {
  content: '💬';
  font-size: 32px;
  opacity: 0.4;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .slc-support-grid {
    grid-template-columns: 260px 1fr;
  }
}

@media (max-width: 992px) {
  .slc-support-grid {
    grid-template-columns: 1fr;
  }
  .slc-support-left {
    max-height: 240px;
    border-right: none;
    border-bottom: 1px solid #e4e6ea;
  }
  .slc-support-right {
    max-height: calc(100vh - 340px);
  }
}

@media (max-width: 768px) {
  .slc-support-header {
    padding: 0 12px;
    height: 46px;
  }
  .slc-support-header h1,
  .slc-support-header h2 {
    font-size: 15px;
  }
  .slc-support-grid {
    height: calc(100vh - 46px);
    max-height: calc(100vh - 46px);
  }
  .slc-bubble { max-width: 85%; }
}

/* Focus States */
button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(242, 98, 40, 0.4);
  outline-offset: 2px;
}

/* Başlıkta Sohbeti Sonlandır Butonu */
.slc-end-chat-header-btn {
  background: rgba(220, 53, 69, 0.9);
  color: white;
  padding: 4px 10px;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.slc-end-chat-header-btn:hover {
  background: #dc3545;
}
.slc-end-chat-header-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== BOT GEÇMİŞİ STİLLERİ ===== */
.slc-msg.bot-history .slc-bubble {
  font-size: 12.5px;
  color: #111 !important;
}
.slc-msg.agent.bot-history .slc-bubble {
  background: #d0d7e8 !important;
  border-left: 3px solid #3f51b5 !important;
  color: #111 !important;
}
.slc-msg.user.bot-history .slc-bubble {
  background: #ffe0b2 !important;
  border-left: 3px solid #fb8c00 !important;
  color: #111 !important;
}
.slc-bot-history-separator {
  text-align: center;
  padding: 10px 0;
  margin: 8px 0;
  position: relative;
}
.slc-bot-history-separator span {
  background: #f5f5f5;
  padding: 4px 14px;
  font-size: 11px;
  color: #666;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-weight: 500;
}

/* ===== GELİŞTİRİCİ KREDİSİ ===== */
.slc-credits {
  text-align: center;
  padding: 6px 12px;
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}
.slc-credits a {
  color: #555;
  text-decoration: none;
  font-weight: 600;
}
.slc-credits a:hover {
  color: #1a73e8;
  text-decoration: underline;
}
