/* ==========================================================================
   icq.css — the ICQ application itself, dressed for Windows XP
   Skin-able: defaults below are "ICQ Green"; themes.css swaps them per
   body.skin-*  (header gradients, accents, list and message colours).
   ========================================================================== */

:root {
  --icq-head-grad: linear-gradient(180deg, #fbfbf8 0%, #e8f0dd 60%, #d8e6c6 100%);
  --icq-head-border: #b9c8a8;
  --icq-accent: #24560f;
  --icq-accent-soft: #5d7a48;
  --icq-group-grad: linear-gradient(180deg, #f3f7ec 0%, #e4eed6 100%);
  --icq-group-fg: #35592a;
  --icq-group-border: #cfdcbc;
  --icq-group-count: #6f8a5e;

  --icq-list-bg: #fff;
  --icq-list-fg: #000;
  --icq-list-hover: #e8f0fb;
  --icq-list-offline-fg: #7b7b7b;
  --icq-uin-fg: #8a8a8a;
  --icq-unread-fg: #b00;

  --icq-msg-head-grad: linear-gradient(180deg, #fbfbf8 0%, #eceadd 100%);
  --icq-msg-head-border: #c8c4b5;
  --icq-history-bg: #fff;
  --icq-history-fg: #000;
  --icq-in-fg: #b00000;
  --icq-out-fg: #0033aa;
  --icq-time-fg: #8a8a8a;
  --icq-sys-fg: #7a7a7a;
  --icq-daysep-fg: #999;
  --icq-daysep-line: #e2e2e2;
  --icq-typing-bg: #f7f7f2;

  --icq-hero-grad: linear-gradient(180deg, #ffffff 0%, #e9f2dc 45%, #d6e7bf 100%);
  --icq-hero-border: #b6c9a0;
  --icq-hero-fg: #2f6b16;
  --icq-hero-sub: #4c6b3a;

  --icq-field-bg: #fff;
  --icq-field-fg: #000;
  --icq-field-border: #7f9db9;
}

/* --------------------------------------------------------------------------
   Login / registration
   -------------------------------------------------------------------------- */

.login-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--icq-hero-grad);
  border-bottom: 1px solid var(--icq-hero-border);
}

.login-hero .flower {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.login-hero h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--icq-hero-fg);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .7);
}

.login-hero p {
  margin: 2px 0 0;
  color: var(--icq-hero-sub);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px 0;
  background: var(--xp-face);
}

/* Unselected tabs are darker than the panel and sit lower, so the selected
   one reads as raised and joined to the page below it — the XP convention. */
.tab {
  padding: 3px 12px;
  margin-top: 2px;
  border: 1px solid #919b9c;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #efecdf 0%, #dbd7c6 100%);
  color: #4c4c4c;
  position: relative;
  cursor: default;
}

.tab:hover:not(.active) {
  background: linear-gradient(180deg, #f7f5ee 0%, #e5e1d2 100%);
}

.tab.active {
  margin-top: 0;
  padding-bottom: 5px;
  margin-bottom: -1px;         /* swallow the panel's top border */
  z-index: 2;
  background: var(--xp-face);
  color: #000;
  font-weight: bold;
}

.tab-panels {
  flex: 1;
  min-height: 0;
  border-top: 1px solid #919b9c;
  padding: 12px 14px;
  background: var(--xp-face);
  overflow: auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.error-text {
  color: #c00;
  min-height: 14px;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Contact list window
   -------------------------------------------------------------------------- */

.cl-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  background: var(--icq-head-grad);
  border-bottom: 1px solid var(--icq-head-border);
}

.cl-header .flower {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}

.cl-header .me-nick {
  font-weight: bold;
  font-size: 12px;
  color: var(--icq-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cl-header .me-uin {
  color: var(--icq-accent-soft);
}

.cl-search {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 4px 5px;
  background: var(--xp-face);
}

.cl-search input {
  flex: 1;
  min-width: 0;
}

.list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--icq-list-bg);
  color: var(--icq-list-fg);
  border-top: 1px solid var(--icq-field-border);
  border-bottom: 1px solid var(--icq-field-border);
  padding: 2px 0 6px;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 2px;
  margin-top: 3px;
  font-weight: bold;
  color: var(--icq-group-fg);
  background: var(--icq-group-grad);
  border-top: 1px solid rgba(255, 255, 255, .55);
  border-bottom: 1px solid var(--icq-group-border);
  cursor: default;
}

.group-head .twisty {
  width: 9px;
  font-size: 9px;
  color: var(--icq-group-count);
}

.group-head .count {
  margin-left: auto;
  font-weight: normal;
  color: var(--icq-group-count);
}

.contact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 14px;
  cursor: default;
  line-height: 15px;
}

.contact .flower {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.contact .nick {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact .uin {
  color: var(--icq-uin-fg);
  font-size: 10px;
}

.contact:hover {
  background: var(--icq-list-hover);
}

.contact.selected {
  background: var(--xp-selection);
  color: #fff;
}

.contact.selected .uin {
  color: #d6e3f7;
}

.contact.offline .nick {
  color: var(--icq-list-offline-fg);
}

.contact.unread .nick {
  font-weight: bold;
  color: var(--icq-unread-fg);
}

.contact.unread .flower {
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: .25; }
}

.list-empty {
  padding: 14px 12px;
  color: #777;
  text-align: center;
  line-height: 1.5;
}

.cl-footer {
  flex: 0 0 auto;
  display: flex;
  gap: 3px;
  padding: 4px 5px 5px;
  background: var(--xp-face);
}

.cl-footer .xp-btn {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 6px;
  height: 24px;
}

.cl-footer .flower {
  width: 15px;
  height: 15px;
}

/* --------------------------------------------------------------------------
   Status menu
   -------------------------------------------------------------------------- */

.popup-menu {
  position: absolute;
  z-index: 9700;
  min-width: 168px;
  padding: 2px;
  background: #fff;
  border: 1px solid #a0a0a0;
  box-shadow: 3px 3px 8px rgba(0, 0, 0, .35);
}

.popup-menu .mi {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 7px;
  cursor: default;
}

.popup-menu .mi:hover {
  background: var(--xp-selection);
  color: #fff;
}

.popup-menu .mi .flower {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.popup-menu .mi.checked::after {
  content: "•";
  margin-left: auto;
}

.popup-menu .sep {
  height: 1px;
  margin: 3px 2px;
  background: #d6d3c8;
}

/* --------------------------------------------------------------------------
   Message window
   -------------------------------------------------------------------------- */

.msg-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  background: var(--icq-msg-head-grad);
  border-bottom: 1px solid var(--icq-msg-head-border);
}

.msg-head .flower {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.msg-head .who {
  font-weight: bold;
  font-size: 12px;
}

.msg-head .meta {
  color: var(--icq-accent-soft);
}

.msg-head .status-word {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid var(--icq-msg-head-border);
  border-radius: 9px;
  background: var(--icq-field-bg);
  color: var(--icq-field-fg);
}

.history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px;
  background: var(--icq-history-bg);
  color: var(--icq-history-fg);
  border-bottom: 1px solid var(--icq-msg-head-border);
  font-size: 12px;
  user-select: text;
  cursor: auto;
}

.history .entry {
  margin-bottom: 7px;
  line-height: 1.35;
  word-wrap: break-word;
}

.history .entry .head {
  font-weight: bold;
  font-size: 11px;
}

.history .entry.in .head {
  color: var(--icq-in-fg);
}

.history .entry.out .head {
  color: var(--icq-out-fg);
}

.history .entry .head .time {
  font-weight: normal;
  color: var(--icq-time-fg);
  margin-left: 4px;
}

.history .entry .text {
  white-space: pre-wrap;
}

.history .entry.auto .text {
  font-style: italic;
  color: var(--icq-sys-fg);
}

.history .day-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--icq-daysep-fg);
  font-size: 10px;
}

.history .day-sep::before,
.history .day-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--icq-daysep-line);
}

.history .sys {
  color: var(--icq-sys-fg);
  font-style: italic;
  margin-bottom: 6px;
}

.typing-line {
  flex: 0 0 16px;
  padding: 1px 8px;
  font-size: 10px;
  color: var(--icq-sys-fg);
  font-style: italic;
  background: var(--icq-typing-bg);
  border-bottom: 1px solid var(--icq-msg-head-border);
  visibility: hidden;
}

.typing-line.on {
  visibility: visible;
}

.compose {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 5px;
  gap: 5px;
  background: var(--xp-face);
}

.compose textarea {
  height: 62px;
  min-height: 40px;
  resize: none;
  cursor: auto;
  background: var(--icq-field-bg);
  color: var(--icq-field-fg);
  border-color: var(--icq-field-border);
}

.compose-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.compose-row .grow {
  flex: 1;
}

.send-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: bold;
  min-width: 84px;
  justify-content: center;
}

.emoji-bar {
  display: flex;
  gap: 2px;
}

.emoji-bar .emo {
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12px;
  cursor: default;
}

.emoji-bar .emo:hover {
  border-color: #b6b2a3;
  background: #fff;
}

.compose-row .gif-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 20px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: bold;
}

/* --------------------------------------------------------------------------
   GIFs
   -------------------------------------------------------------------------- */

.history .entry .gif {
  display: block;
  max-width: 220px;
  max-height: 200px;
  margin-top: 3px;
  border: 1px solid var(--icq-msg-head-border);
  background: #fff;
}

.gif-grid {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--xp-field-border);
  align-content: start;
}

.gif-cell {
  border: 1px solid #dcd8cc;
  background: #f6f5f0;
  overflow: hidden;
  cursor: default;
  display: grid;
  place-items: center;
  min-height: 76px;
}

.gif-cell img {
  width: 100%;
  height: auto;
  display: block;
}

.gif-cell:hover {
  border-color: #e2a038;
  box-shadow: inset 0 0 0 1px #fee9a4;
}

/* --------------------------------------------------------------------------
   Find / add users
   -------------------------------------------------------------------------- */

.results {
  flex: 1;
  min-height: 100px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #7f9db9;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border-bottom: 1px solid #f0f0f0;
}

.result-row .flower {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.result-row .r-nick {
  font-weight: bold;
}

.result-row .r-uin {
  color: #777;
}

.result-row .spacer {
  flex: 1;
}

.result-row button {
  min-width: 58px;
  min-height: 19px;
  padding: 0 8px;
}

/* --------------------------------------------------------------------------
   User details
   -------------------------------------------------------------------------- */

.details-grid {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 4px 8px;
  align-items: baseline;
}

.details-grid .k {
  color: #4a4a4a;
  text-align: right;
}

.details-grid .v {
  font-weight: bold;
  user-select: text;
  cursor: auto;
}

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.about {
  display: flex;
  gap: 12px;
  padding: 14px;
}

.about .flower {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}

.about h2 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #2f6b16;
}

.about p {
  margin: 0 0 6px;
  line-height: 1.5;
}

.about code {
  font-family: "Lucida Console", Consolas, monospace;
  background: #fff;
  border: 1px solid #dcd8cc;
  padding: 0 3px;
  user-select: text;
}
