/* ============================================================
   TOKSY — Секретный чат
   ============================================================ */

/* ============================================================
   ШИТ ПОДТВЕРЖДЕНИЯ
   ============================================================ */

.secret-intro {
  text-align: center;
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 20px;
}

.secret-intro-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007aff 0%, #5ac8fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

.secret-intro h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.secret-intro p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  padding: 0 12px;
}

.secret-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.secret-feature {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.secret-feature-icon {
  font-size: 20px;
  line-height: 1;
}

.secret-feature span:last-child {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
}

.secret-lifetime-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.secret-lifetime-option {
  padding: 12px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--separator);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.secret-lifetime-option:hover {
  background: var(--bg-input);
}

.secret-lifetime-option.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.secret-lifetime-option:active {
  transform: scale(0.97);
}

.secret-note {
  background: rgba(255, 149, 0, 0.1);
  border-left: 3px solid var(--orange);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #b36a00;
  line-height: 1.55;
  margin-top: 16px;
}

/* ============================================================
   ЭКРАН СЕКРЕТНОГО ЧАТА
   ============================================================ */

.secret-chat-screen {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: var(--bg-chat);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  overflow: hidden;
}

.secret-chat-screen.open {
  opacity: 1;
  transform: translateY(0);
}

.secret-chat-screen.hidden {
  display: none !important;
}

.secret-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
  min-height: 62px;
  flex-shrink: 0;
}

.secret-chat-header .back-btn {
  display: inline-flex !important;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--blue);
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.secret-chat-header .back-btn:active {
  background: rgba(0, 122, 255, 0.1);
}

.secret-chat-title-block {
  flex: 1;
  min-width: 0;
}

.secret-chat-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.secret-lock-icon {
  color: var(--green);
  flex-shrink: 0;
}

.secret-chat-title-block h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.secret-chat-sub {
  font-size: 12px;
  color: var(--green);
  margin: 2px 0 0;
  font-weight: 500;
}

.secret-timer {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.secret-timer svg {
  flex-shrink: 0;
}

.secret-warning-bar {
  background: rgba(52, 199, 89, 0.08);
  border-bottom: 1px solid rgba(52, 199, 89, 0.15);
  color: #1b8c3d;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 16px;
  text-align: center;
  flex-shrink: 0;
}

.secret-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-chat);
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.secret-messages .message {
  max-width: 75%;
}

.secret-messages .msg-bubble {
  padding: 9px 14px;
  border-radius: 18px;
  word-wrap: break-word;
}

.secret-messages .message.incoming {
  align-self: flex-start;
}

.secret-messages .message.incoming .msg-bubble {
  background: var(--bg-bubble-in);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.secret-messages .message.outgoing {
  align-self: flex-end;
}

.secret-messages .message.outgoing .msg-bubble {
  background: var(--bg-bubble-out);
  color: var(--text-inverse);
  border-bottom-right-radius: 4px;
}

.secret-messages .msg-text {
  font-size: 15px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.secret-messages .msg-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-top: 3px;
}

.secret-messages .message.incoming .msg-meta {
  color: var(--text-tertiary);
}

.secret-messages .message.outgoing .msg-meta {
  color: rgba(255, 255, 255, 0.75);
}

.secret-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--separator);
  flex-shrink: 0;
}

.secret-composer .composer-input {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border-radius: 20px;
}

.secret-composer .composer-input:focus-within {
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.secret-composer .composer-input input {
  flex: 1;
  padding: 10px 16px;
  font-size: 15px;
  min-width: 0;
  color: var(--text-primary);
  border: none;
  background: transparent;
  outline: none;
}

.secret-composer .send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}

.secret-composer .send-btn:active {
  transform: scale(0.94);
}

.secret-actions {
  display: flex;
  gap: 8px;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--separator);
  flex-shrink: 0;
}

.secret-action-btn {
  flex: 1;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--separator);
  background: var(--bg-card);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.secret-action-btn:active {
  transform: scale(0.97);
}

.secret-action-btn.leave {
  color: var(--orange);
  border-color: rgba(255, 149, 0, 0.3);
}

.secret-action-btn.leave:hover {
  background: rgba(255, 149, 0, 0.06);
}

.secret-action-btn.destroy {
  color: var(--red);
  border-color: rgba(255, 59, 48, 0.3);
}

.secret-action-btn.destroy:hover {
  background: rgba(255, 59, 48, 0.06);
}

/* ============================================================
   КНОПКА 🔒 В ШАПКЕ ЧАТА (мобильная + ПК)
   ============================================================ */

.secret-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(52, 199, 89, 0.12);
  color: #34c759;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 6px;
  transition: background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.secret-toggle-btn svg {
  display: block;
}

.secret-toggle-btn:hover {
  background: rgba(52, 199, 89, 0.2);
}

.secret-toggle-btn:active {
  transform: scale(0.92);
  background: rgba(52, 199, 89, 0.25);
}

html.theme-dark .secret-toggle-btn {
  background: rgba(52, 199, 89, 0.18);
  color: #4ade80;
}

@media (max-width: 640px) {
  .secret-toggle-btn {
    width: 36px;
    height: 36px;
    margin-left: 4px;
  }

  .secret-toggle-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* ============================================================
   ТЁМНАЯ ТЕМА
   ============================================================ */

html.theme-dark .secret-warning-bar {
  background: rgba(52, 199, 89, 0.1);
  color: #4ade80;
  border-bottom-color: rgba(52, 199, 89, 0.2);
}

html.theme-dark .secret-note {
  background: rgba(255, 149, 0, 0.12);
  color: #fbbf24;
}

html.theme-dark .secret-timer {
  background: rgba(0, 122, 255, 0.15);
}

/* ============================================================
   СЕРАЯ ТЕМА (nord)
   ============================================================ */

html.theme-nord .secret-timer {
  background: rgba(94, 129, 172, 0.15);
  color: #5e81ac;
}

html.theme-nord .secret-lifetime-option.active {
  background: #5e81ac;
  border-color: #5e81ac;
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */

@media (max-width: 640px) {
  .secret-intro-icon {
    width: 64px;
    height: 64px;
  }

  .secret-intro h3 {
    font-size: 17px;
  }

  .secret-intro p {
    font-size: 12.5px;
  }

  .secret-feature span:last-child {
    font-size: 10px;
  }

  .secret-lifetime-option {
    padding: 10px 6px;
    font-size: 12px;
  }

  .secret-chat-header {
    padding: 8px 12px;
    min-height: 56px;
  }

  .secret-chat-title-block h2 {
    font-size: 14px;
  }

  .secret-chat-sub {
    font-size: 11px;
  }

  .secret-timer {
    padding: 5px 10px;
    font-size: 12px;
  }

  .secret-messages {
    padding: 16px 12px;
  }

  .secret-messages .message {
    max-width: 82%;
  }

  .secret-composer {
    padding: 10px 12px;
  }

  .secret-actions {
    padding: 8px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .secret-action-btn {
    padding: 10px 10px;
    font-size: 12px;
  }
}

/* ============================================================
   ДЕСКТОП
   ============================================================ */

@media (min-width: 1000px) {
  .secret-chat-screen {
    left: 264px;
  }

  .secret-messages {
    padding: 24px 40px;
  }

  .secret-composer {
    padding: 12px 40px;
  }

  .secret-actions {
    padding: 12px 40px calc(16px + env(safe-area-inset-bottom, 0px));
  }
}