@import url('./base.css');
@import url('./layout.css');
@import url('./components.css');

:root {
  color-scheme: dark;
  --bg: #050806;
  --panel: #0b110d;
  --panel-2: #101912;
  --panel-3: #142218;
  --line: #1f3528;
  --text: #edf8f1;
  --muted: #8da496;
  --soft: #17291f;
  --accent: #16f29a;
  --accent-2: #49ffbf;
  --danger: #ff5f70;
  --shadow: 0 24px 90px rgba(0, 0, 0, .45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@keyframes logoBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.brand-mark {
  cursor: pointer;
  transition: transform .2s ease;
}

.brand-mark:hover {
  animation: logoBounce .35s ease;
}

.brand-mark:active {
  transform: translateY(-1px) scale(0.98);
}

.brand-name {
  display: inline-block;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(22, 242, 154, .16), transparent 28rem),
    linear-gradient(135deg, #020403, #07120c 44%, #020302);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  align-items: center;
  gap: 36px;
  padding: clamp(24px, 6vw, 76px);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid rgba(73, 255, 191, .2);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(6, 12, 8, .45), rgba(1, 4, 3, .95)),
    repeating-linear-gradient(90deg, rgba(22, 242, 154, .12) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(22, 242, 154, .08) 0 1px, transparent 1px 96px);
  box-shadow: var(--shadow);
}

.brand-mark,
.guild-logo {
  display: grid;
  place-items: center;
  color: #03130b;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
}

.brand-mark {
  width: 86px;
  height: 86px;
  margin-bottom: 30px;
  border-radius: 8px;
  font-size: 44px;
  box-shadow: 0 0 50px rgba(22, 242, 154, .28);
}

.eyebrow,
.muted,
.form-note {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(52px, 8vw, 110px);
  line-height: .88;
  letter-spacing: 0;
}

.brand-copy {
  max-width: 620px;
  margin-bottom: 0;
  color: #c5d6ca;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.45;
}

.signal-lines {
  position: absolute;
  inset: 44px 44px auto auto;
  display: grid;
  gap: 10px;
  width: 180px;
}

.signal-lines span {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: pulseLine 1.8s infinite ease-in-out;
}

.signal-lines span:nth-child(2) { animation-delay: .15s; }
.signal-lines span:nth-child(3) { animation-delay: .3s; }
.signal-lines span:nth-child(4) { animation-delay: .45s; }

@keyframes pulseLine {
  50% { opacity: .25; transform: translateX(-18px); }
}

.auth-card,
.dialog-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 15, 10, .92);
  box-shadow: var(--shadow);
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  background: #070c09;
}

.tab,
.soft-btn,
.icon-btn,
.circle-action,
.danger-btn {
  border: 1px solid transparent;
  color: var(--text);
  background: var(--soft);
  transition: .16s ease;
}

.tab {
  height: 42px;
}

.tab.active,
.soft-btn:hover,
.icon-btn:hover,
.circle-action:hover {
  border-color: rgba(22, 242, 154, .35);
  background: #203828;
}

label {
  display: grid;
  gap: 8px;
  color: #d6e6dc;
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  outline: none;
  color: var(--text);
  background: #060a08;
}

select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 38px 0 14px;
  outline: none;
  color: var(--text);
  background:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%) right 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--accent) 50%, transparent 50%) right 12px center / 7px 7px no-repeat,
    #060a08;
  appearance: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 242, 154, .12);
}

.primary-btn {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  color: #03130b;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 900;
}

.workspace {
  height: 100vh;
  display: grid;
  grid-template-columns: 76px 270px minmax(0, 1fr) 250px;
  background: var(--bg);
}

.guild-rail,
.channel-panel,
.member-panel {
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #060a08;
}

.guild-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
}

.guild-list {
  display: grid;
  gap: 10px;
}

.guild-logo,
.circle-action {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 8px;
}

.guild-logo:not(.active) {
  color: var(--text);
  background: var(--panel-3);
}

.composer {
  position: absolute;
  bottom: 0;
  width: 100%;
}

.chat-panel {
  position: relative;
}

.circle-action {
  margin-top: auto;
  color: var(--accent);
  font-size: 28px;
  background: var(--panel-2);
}

.channel-panel,
.member-panel {
  display: flex;
  flex-direction: column;
}

.server-header,
.chat-header,
.profile-strip,
.dialog-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.server-header,
.chat-header {
  position: relative;
  min-height: 74px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.server-header h2,
.chat-header h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
}

.channel-list {
  flex: 1;
  overflow: auto;
  padding: 12px 10px;
}

.channel-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: #bdd1c4;
  background: transparent;
  text-align: left;
}

.channel-btn.active,
.channel-btn:hover {
  color: var(--text);
  background: var(--panel-3);
}

.profile-strip {
  min-height: 76px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #08100b;
}

.profile-strip > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.profile-strip strong,
.profile-strip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-strip span {
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #04120a;
  background: var(--accent);
  background-size: cover;
  background-position: center;
  font-weight: 900;
}

.chat-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background:
    linear-gradient(rgba(5, 8, 6, .92), rgba(5, 8, 6, .97)),
    linear-gradient(90deg, transparent 0 48px, rgba(22, 242, 154, .04) 48px 49px, transparent 49px 96px);
}

.header-actions,
.call-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.soft-btn,
.danger-btn {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 800;
}

.danger-btn {
  background: rgba(255, 95, 112, .14);
  color: #ffd8de;
  border-color: rgba(255, 95, 112, .35);
}

.call-panel {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 18, 12, .86);
}

.call-panel > div:first-child {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.call-panel strong {
  color: var(--text);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #020403;
  object-fit: cover;
}

.messages {
  min-height: 0;
  overflow: auto;
  padding: 24px 20px;
}

.message {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
}

.message:hover {
  background: rgba(255, 255, 255, .018);
}

.message-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.message-meta strong {
  color: var(--author-color, var(--accent));
}

.message-meta time {
  color: var(--muted);
  font-size: 12px;
}

.message p {
  margin: 3px 0 0;
  color: #dcebe1;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

#messageForm button[type="submit"] {
  width: auto;
  max-width: 220px;
  justify-self: end;
  white-space: nowrap;
}

.member-panel {
  gap: 14px;
  padding: 18px;
  border-left: 1px solid var(--line);
  border-right: 0;
}

.member-panel h3 {
  margin-bottom: 0;
}

.direct-chat-panel {
  display: grid;
  gap: 10px;
}

.direct-chat-panel h4 {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.user-list {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
}

.user-card {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.user-card strong {
  display: block;
  font-size: 13px;
}

.user-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.small-btn {
  min-width: auto;
  padding: 6px 12px;
  font-size: 12px;
}

.stat-tile {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat-tile span,
.mini-console {
  color: var(--muted);
  font-size: 12px;
}

.mini-console {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
}

dialog {
  width: min(440px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(0, 0, 0, .62);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.dialog-card h2 {
  margin: 0;
  font-size: 20px;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 68px 240px minmax(0, 1fr);
  }

  .member-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .brand-panel {
    min-height: 320px;
  }

  .workspace {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .channel-panel {
    grid-column: 2;
    min-height: 260px;
  }

  .guild-rail {
    grid-row: 1 / span 2;
  }

  .chat-panel {
    grid-column: 2;
    min-height: 60vh;
  }

  .composer {
    grid-template-columns: 1fr;
  }
}
