/* =========================================================
   CHAT & UI COMPONENTS (KorporatHub Styling)
   ========================================================= */

/* Top Status Header */
.app-header {
  flex-shrink: 0;
  background: #1e293b;
  color: #f8fafc;
  padding: 10px 14px;
  border-bottom: 1px solid #334155;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: #38bdf8;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: #334155;
  border: 1px solid #475569;
  color: #f8fafc;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #475569;
}

.panic-btn {
  background: #047857;
  border-color: #10b981;
  font-weight: bold;
}
.panic-btn:hover {
  background: #059669;
}

.shield-badge {
  background: #2563eb;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 12px;
  animation: pulseCritical 1.5s infinite;
}

/* Status Gauge Row */
.header-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #0f172a;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
}

.stat-value {
  color: #f8fafc;
  font-weight: 700;
}

.stat-bar-track {
  width: 100%;
  height: 7px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #334155;
}

.stat-fill {
  height: 100%;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.stat-high { background-color: #10b981; }
.stat-mid { background-color: #f59e0b; }
.stat-low { background-color: #ef4444; }

.stat-high-rep { background-color: #3b82f6; }
.stat-mid-rep { background-color: #8b5cf6; }
.stat-low-rep { background-color: #ef4444; }

.clock-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #e2e8f0;
  background: #1e293b;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #475569;
  letter-spacing: 0.5px;
}

/* Item Alibi Quick Tray */
.item-tray {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #0f172a;
  padding: 6px 10px;
  border-bottom: 1px solid #334155;
}

.item-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.item-btn:hover:not(:disabled) {
  background: #334155;
  border-color: #64748b;
}

.item-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.item-badge {
  background: #3b82f6;
  color: white;
  padding: 1px 5px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Chat History Area */
.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #090d16;
  background-image: radial-gradient(#1e293b 0.75px, transparent 0.75px);
  background-size: 16px 16px;
  scroll-behavior: smooth;
}

/* Chat Bubbles */
.chat-bubble {
  max-width: 82%;
  display: flex;
  gap: 8px;
}

.chat-bubble.incoming {
  align-self: flex-start;
}

.chat-bubble.outgoing {
  align-self: flex-end;
  justify-content: flex-end;
}

.bubble-avatar {
  width: 34px;
  height: 34px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.bubble-content {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px 12px 12px 2px;
  padding: 9px 12px;
  color: #f1f5f9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.outgoing .bubble-content {
  background: #0369a1;
  border-color: #0284c7;
  border-radius: 12px 12px 2px 12px;
}

.boss-bubble .bubble-content {
  background: #450a0a;
  border-color: #dc2626;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

.bubble-sender {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sender-role {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 400;
}

.bubble-text {
  font-size: 0.88rem;
  line-height: 1.35;
  word-break: break-word;
}

.bubble-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.bubble-time {
  font-size: 0.65rem;
  color: #94a3b8;
}

.read-receipt {
  font-size: 0.75rem;
  font-weight: 700;
}
.read-receipt.double-blue {
  color: #38bdf8;
}

/* Typing Indicator Box */
.typing-box {
  align-self: flex-start;
  display: flex;
  align-items: center;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 8px 12px;
}

/* Action Deck Area */
.action-deck {
  flex-shrink: 0;
  background: #111827;
  border-top: 1px solid #374151;
  padding: 10px 12px;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.deck-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  margin-bottom: 5px;
}

.timer-track {
  width: 100%;
  height: 6px;
  background: #1f2937;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.timer-fill {
  height: 100%;
  transition: width 0.9s linear, background-color 0.3s ease;
}

.timer-safe { background-color: #10b981; }
.timer-warning { background-color: #f59e0b; }
.timer-danger { background-color: #ef4444; }

.action-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.action-card {
  width: 100%;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 8px 11px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.action-card:hover:not(:disabled) {
  background: #334155;
  border-color: #60a5fa;
  transform: translateY(-1px);
}

.action-card:active:not(:disabled) {
  transform: translateY(1px);
}

.card-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 700;
}

.card-shortcut-badge {
  background: #0f172a;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 1px 4px;
  border-radius: 4px;
}

.card-type-tag {
  color: #cbd5e1;
}

.card-effect-preview {
  margin-left: auto;
  font-size: 0.66rem;
  color: #38bdf8;
}

.card-text {
  font-size: 0.82rem;
  color: #f8fafc;
  line-height: 1.3;
}

/* Card Specific Styling */
.card-type-yes_man { border-left: 3px solid #ef4444; }
.card-type-diplomat { border-left: 3px solid #3b82f6; }
.card-type-alasan_konyol { border-left: 3px solid #f59e0b; }
.card-type-tumbal { border-left: 3px solid #10b981; }

.disabled-deck .action-card {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Modals & Overlays */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 14px;
  max-width: 380px;
  width: 100%;
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-header-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 16px;
}

.modal-body {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 18px;
  text-align: left;
}

.rules-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rules-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.primary-btn {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.primary-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

.end-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.badge-win { background: #059669; color: #ecfdf5; }
.badge-lose { background: #dc2626; color: #fef2f2; }

.end-quote {
  margin-top: 12px;
  font-style: italic;
  color: #94a3b8;
  font-size: 0.78rem;
  border-top: 1px dashed #475569;
  padding-top: 10px;
}

/* Fake Excel Screen (Panic Button) */
.fake-excel-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  color: #000;
  z-index: 99;
  overflow: auto;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 11px;
}

.excel-ribbon {
  background: #107c41;
  color: white;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
}

.excel-table th, .excel-table td {
  border: 1px solid #d4d4d4;
  padding: 4px 8px;
  text-align: left;
}

.excel-table th {
  background: #f3f2f1;
}

/* Utility */
.hidden { display: none !important; }
