/**
 * GÖKÇE İLETİŞİM MERKEZİ (UNIFIED INBOX) MICRO-APP STYLESHEET
 * Theme: GökçeOS WebOS Dark Glassmorphism — G-083 Standard
 */

.gkv2-comms-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #090d16;
  color: #f1f5f9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
  box-sizing: border-box;
}

/* 1. TOP CONTENT COMMAND BAR (G-083 Single Header Standard) */
.gkv2-comms-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
  min-height: 44px;
  box-sizing: border-box;
}

.command-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  white-space: nowrap;
}

.command-bar-icon {
  font-size: 15px;
}

.command-bar-title {
  color: #ffffff;
  font-weight: 700;
}

.command-bar-count {
  font-size: 11px;
  color: #94a3b8;
}

.command-bar-center {
  flex: 1;
  max-width: 420px;
}

.gkv2-comms-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.gkv2-comms-search-box .search-icon {
  position: absolute;
  left: 9px;
  font-size: 12px;
  color: #64748b;
  pointer-events: none;
}

.gkv2-comms-search-input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 12px;
  outline: none;
  transition: all 0.15s ease;
}

.gkv2-comms-search-input:focus {
  border-color: #38bdf8;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.command-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.gkv2-comms-tool-btn {
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gkv2-comms-tool-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.gkv2-comms-primary-btn {
  padding: 5px 12px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.gkv2-comms-primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* 2. MAIN 3-PANEL WORKSPACE (G-084 Standard) */
.gkv2-comms-workspace {
  display: grid;
  grid-template-columns: var(--gokce-nav-sidebar-width, 220px) 310px 1fr;
  flex: 1;
  overflow: hidden;
}

/* PANEL 1: GROUPED TEXT-ONLY SIDEBAR */
.gkv2-comms-channels-pane {
  background: #0b0f19;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.gkv2-comms-nav-group-title {
  font-size: 10px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 14px 4px 14px;
  margin: 0;
  line-height: 1;
  box-sizing: border-box;
}

.gkv2-comms-nav-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gkv2-comms-channel-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  margin: 0;
  width: 100%;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.gkv2-comms-channel-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
}

.gkv2-comms-channel-btn.active {
  background: rgba(14, 165, 233, 0.12);
  box-shadow: inset 3px 0 0 #38bdf8;
  color: #38bdf8;
  font-weight: 600;
}

.gkv2-comms-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.gkv2-comms-badge.unread {
  background: #0284c7;
  color: #ffffff;
}

/* PANEL 2: CONVERSATION LIST */
.gkv2-comms-inbox-pane {
  background: #0d1322;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gkv2-comms-conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gkv2-comms-conv-card {
  padding: 9px 11px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.gkv2-comms-conv-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.gkv2-comms-conv-card.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: inset 3px 0 0 #38bdf8;
}

.gkv2-comms-conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.gkv2-comms-conv-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: #f8fafc;
}

.gkv2-comms-conv-time {
  font-size: 10px;
  color: #64748b;
}

.gkv2-comms-conv-snippet {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.gkv2-comms-conv-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.gkv2-comms-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

/* PANEL 3: CHAT PANE & COMPOSER */
.gkv2-comms-chat-pane {
  display: flex;
  flex-direction: column;
  background: #090d16;
  overflow: hidden;
}

.gkv2-comms-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gkv2-comms-thread-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gkv2-comms-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
}

.gkv2-comms-messages-feed {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gkv2-comms-msg-row {
  display: flex;
  width: 100%;
}

.gkv2-comms-msg-row.customer {
  justify-content: flex-start;
}

.gkv2-comms-msg-row.staff {
  justify-content: flex-end;
}

.gkv2-comms-msg-bubble {
  max-width: 72%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.gkv2-comms-msg-row.customer .gkv2-comms-msg-bubble {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-bottom-left-radius: 2px;
}

.gkv2-comms-msg-row.staff .gkv2-comms-msg-bubble {
  background: #0369a1;
  color: #ffffff;
  border-bottom-right-radius: 2px;
}

.gkv2-comms-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  opacity: 0.75;
  margin-bottom: 4px;
}

.gkv2-comms-msg-text {
  word-break: break-word;
}

.gkv2-comms-attachment {
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gkv2-comms-composer {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gkv2-comms-composer-guard {
  font-size: 10.5px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 4px 8px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gkv2-comms-composer-input-row {
  display: flex;
  gap: 8px;
}

.gkv2-comms-composer-input {
  flex: 1;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  font-size: 11.5px;
  resize: none;
  outline: none;
  font-family: inherit;
}

.gkv2-comms-send-btn {
  padding: 0 14px;
  border-radius: 6px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0.5;
}

/* 3. UNIFIED THIN STATUS FOOTER */
.gkv2-comms-thin-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(15, 23, 42, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10.5px;
  min-height: 26px;
  box-sizing: border-box;
}

.status-pill {
  padding: 1.5px 7px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
}

.status-pill.fail-closed {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.status-pill.info {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.auth {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* MODALS */
.gkv2-comms-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.gkv2-comms-modal {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  width: 90%;
  max-width: 620px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.gkv2-comms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gkv2-comms-modal-header h3 {
  margin: 0;
  font-size: 13px;
  color: #ffffff;
}

.gkv2-comms-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
}

.gkv2-comms-modal-body {
  padding: 14px;
  max-height: 70vh;
  overflow-y: auto;
}

.gkv2-comms-drawer-btn {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════════════
   G-091 FACEBOOK BUSINESS CONNECTION CENTER (FAIL-CLOSED ONBOARDING)
   ═══════════════════════════════════════════════════════════════════════════ */

.gkv2-comms-fb-pane {
  background: #090d16;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gkv2-comms-fb-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* 1. Header Card */
.gkv2-fb-header-card {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.25), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gkv2-fb-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.gkv2-fb-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gkv2-fb-icon {
  font-size: 26px;
  line-height: 1;
}

.gkv2-fb-title {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.gkv2-fb-subtitle {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #94a3b8;
}

.gkv2-fb-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gkv2-fb-status-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.2;
}

.gkv2-fb-status-badge.not-connected {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.gkv2-fb-status-badge.info {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.gkv2-fb-status-badge.auth {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.gkv2-fb-desc {
  margin: 0;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.45;
}

/* Sections */
.gkv2-fb-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gkv2-fb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gkv2-fb-section-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #e2e8f0;
}

.gkv2-fb-section-tag {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 2. Checklist Grid */
.gkv2-fb-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.gkv2-fb-check-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gkv2-fb-check-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gkv2-fb-check-name {
  font-size: 12px;
  color: #f1f5f9;
}

.gkv2-fb-state-pill {
  font-size: 9.5px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gkv2-fb-state-pill.not_configured {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.gkv2-fb-state-pill.specified {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.gkv2-fb-check-detail {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
}

/* 3. Action Card & Workflow */
.gkv2-fb-action-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gkv2-fb-action-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gkv2-fb-connect-btn {
  padding: 8px 18px;
  border-radius: 6px;
  background: #1d4ed8;
  border: 1px solid #3b82f6;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gkv2-fb-action-notice {
  font-size: 11px;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.gkv2-fb-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gkv2-fb-steps-title {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  color: #cbd5e1;
}

.gkv2-fb-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.gkv2-fb-step-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 9px 11px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.gkv2-fb-step-item .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 750;
  flex-shrink: 0;
}

.gkv2-fb-step-item .step-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gkv2-fb-step-item .step-title {
  font-size: 11.5px;
  color: #f1f5f9;
}

.gkv2-fb-step-item .step-desc {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.3;
}

/* 4. Security Guarantees */
.gkv2-fb-security-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 6px;
  padding: 12px 16px;
}

.gkv2-fb-security-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gkv2-fb-security-list li {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.gkv2-fb-security-list .sec-icon {
  font-size: 12px;
  flex-shrink: 0;
}

/* RESPONSIVE & MOBILE DRAWER (G-091 Standard) */
@media (max-width: 768px) {
  .gkv2-comms-drawer-btn {
    display: inline-flex;
  }

  .gkv2-comms-workspace {
    position: relative;
    grid-template-columns: 1fr;
  }

  .gkv2-comms-channels-pane {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    z-index: 40;
    background: #0b0f19;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.7);
    transform: translateX(-100%);
    transition: transform 0.2s ease-in-out;
  }

  .gkv2-comms-channels-pane.drawer-open {
    transform: translateX(0);
  }

  .gkv2-comms-fb-pane {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .gkv2-comms-command-bar {
    padding: 6px 10px;
    gap: 8px;
  }

  .command-bar-count {
    display: none;
  }

  .gkv2-fb-header-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .gkv2-fb-action-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

