*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --wa-bg: #0b141a;
  --wa-panel: #202c33;
  --wa-panel-hover: #2a3942;
  --wa-text: #e9edef;
  --wa-text-secondary: #8696a0;
  --wa-out-bubble: #005c4b;
  --wa-in-bubble: #202c33;
  --wa-border: #222d34;
  --wa-input-bg: #2a3942;
  --wa-link: #53bdeb;
  --wa-encryption-bg: #182229;
  --wa-encryption-border: #233138;
  --wa-encryption-text: #d1d7db;
  --wa-font: "Segoe UI", "Helvetica Neue", Helvetica, "Lucida Grande", Arial, Ubuntu, Cantarell, "Fira Sans", sans-serif;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--wa-font);
  background: #111b21;
  color: var(--wa-text);
  display: flex;
  overflow: hidden;
}

/* Editor panel */
.editor {
  width: 320px;
  min-width: 320px;
  background: #1f2c34;
  border-right: 1px solid var(--wa-border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform 0.25s ease, margin 0.25s ease;
}

.editor.is-hidden {
  transform: translateX(-100%);
  margin-right: -320px;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--wa-panel);
  border-bottom: 1px solid var(--wa-border);
}

.editor-header h2 {
  font-size: 15px;
  font-weight: 500;
}

.editor-close {
  background: none;
  border: none;
  color: var(--wa-text-secondary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.editor-close:hover {
  color: var(--wa-text);
}

.editor-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
}

.editor-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--wa-text-secondary);
}

.editor-form input,
.editor-form textarea {
  background: var(--wa-input-bg);
  border: 1px solid var(--wa-border);
  border-radius: 8px;
  color: var(--wa-text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  resize: vertical;
}

.editor-form input:focus,
.editor-form textarea:focus {
  outline: none;
  border-color: #00a884;
}

.editor-btn {
  margin-top: 4px;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #00a884;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.editor-btn:hover {
  background: #06cf9c;
}

.editor-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #00a884;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  display: none;
}

.editor.is-hidden ~ .editor-toggle {
  display: block;
}

/* WhatsApp app */
.wa-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  background: var(--wa-bg);
}

.wa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--wa-panel);
  min-height: 59px;
  flex-shrink: 0;
}

.wa-header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.wa-avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wa-contact {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.wa-contact-name {
  font-size: 16px;
  line-height: 21px;
  color: var(--wa-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-contact-status {
  font-size: 13px;
  line-height: 20px;
  color: var(--wa-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wa-icon-btn {
  background: none;
  border: none;
  color: var(--wa-text-secondary);
  cursor: default;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.wa-icon-btn--video {
  display: flex;
  align-items: center;
  gap: 1px;
  padding-right: 2px;
}

.wa-chevron {
  opacity: 0.7;
}

/* Chat area */
.wa-chat {
  flex: 1;
  overflow-y: auto;
  background-color: var(--wa-bg);
  background-image: url("wallpaper.svg");
  background-repeat: repeat;
  background-size: 412px 749px;
}

.wa-chat-inner {
  padding: 20px 60px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
}

.wa-date-pill {
  align-self: center;
  background: var(--wa-encryption-bg);
  color: var(--wa-encryption-text);
  font-size: 12.5px;
  line-height: 20px;
  padding: 5px 12px 6px;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  margin-bottom: 12px;
}

.wa-encryption {
  align-self: center;
  max-width: 420px;
  background: var(--wa-encryption-bg);
  border: 1px solid var(--wa-encryption-border);
  border-radius: 8px;
  padding: 8px 12px 10px;
  margin-bottom: 12px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
}

.wa-encryption svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #ffd279;
}

.wa-encryption span {
  font-size: 12.5px;
  line-height: 19px;
  color: var(--wa-encryption-text);
  text-align: center;
}

.wa-encryption a {
  color: var(--wa-link);
  text-decoration: none;
}

.wa-encryption a:hover {
  text-decoration: underline;
}

/* Messages */
.wa-message {
  display: flex;
  margin-bottom: 2px;
}

.wa-message--out {
  justify-content: flex-end;
}

.wa-message--in {
  justify-content: flex-start;
}

.wa-bubble {
  position: relative;
  max-width: 65%;
  min-width: 60px;
  padding: 6px 7px 8px 9px;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  font-size: 14.2px;
  line-height: 19px;
  word-wrap: break-word;
}

.wa-bubble--out {
  background: var(--wa-out-bubble);
  border-top-right-radius: 0;
}

.wa-bubble--out::before {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  width: 8px;
  height: 13px;
  background: radial-gradient(circle at 100% 0, transparent 8px, var(--wa-out-bubble) 8px);
}

.wa-bubble--in {
  background: var(--wa-in-bubble);
  border-top-left-radius: 0;
}

.wa-bubble--in::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 8px;
  height: 13px;
  background: radial-gradient(circle at 0 0, transparent 8px, var(--wa-in-bubble) 8px);
}

.wa-bubble-text {
  display: inline;
  white-space: pre-wrap;
  color: var(--wa-text);
}

.wa-bubble-meta {
  float: right;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  margin-top: 4px;
  position: relative;
  top: 4px;
}

.wa-time {
  font-size: 11px;
  line-height: 15px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

.wa-bubble--in .wa-time {
  color: var(--wa-text-secondary);
}

.wa-checks {
  display: flex;
  align-items: center;
  line-height: 0;
}

/* Footer */
.wa-footer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 16px;
  background: var(--wa-panel);
  flex-shrink: 0;
}

.wa-input-wrap {
  flex: 1;
}

.wa-input {
  width: 100%;
  background: var(--wa-input-bg);
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 15px;
  line-height: 20px;
  color: var(--wa-text);
  font-family: inherit;
}

.wa-input::placeholder {
  color: var(--wa-text-secondary);
}

@media (max-width: 768px) {
  .wa-chat-inner {
    padding: 16px 24px;
  }

  .wa-bubble {
    max-width: 85%;
  }

  .editor {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
  }

  .editor.is-hidden {
    margin-right: 0;
  }
}
