/* ==============================================
   RUST BALKAN — Lobby UI
   ============================================== */

:root {
  --rust-red: #cd412b;
  --rust-red-hover: #e04d34;
  --rust-red-dark: #a8341f;
  --bg-dark: #1a1a1a;
  --text-primary: #f5f0e8;
  --text-muted: #9c958a;
  --text-dim: #6b645a;
  --panel-bg: rgba(20, 18, 16, 0.85);
  --panel-border: rgba(205, 65, 43, 0.3);
  --shadow-strong: 0 4px 24px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Sakriva sadrzaj vizuelno ali ostavlja za screen readere i SEO */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #000;
  color: var(--text-primary);
  overflow: hidden;
  user-select: none;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ==============================================
   POZADINA
   ============================================== */

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: brightness(0.65) contrast(1.05) saturate(0.95);
  opacity: 0;
  transition: opacity 2.5s ease-in-out;
  will-change: opacity, transform;
  animation: subtleZoom 60s linear infinite alternate;
}

.bg-slide.active {
  opacity: 1;
}

@keyframes subtleZoom {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.3) 40%,
    rgba(0, 0, 0, 0.1) 60%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.6) 100%);
}

/* ==============================================
   LAYOUT
   ============================================== */

.lobby {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  padding: 24px 32px;
  gap: 24px;
}

/* ==============================================
   LOGO
   ============================================== */

.logo-area {
  grid-column: 1;
  grid-row: 1;
}

.logo {
  display: inline-block;
  line-height: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.logo:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 4px 16px rgba(205,65,43,0.5));
}

.logo-img {
  width: auto;
  height: 195px;
  max-width: 100%;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.7));
}

@media (max-width: 900px) {
  .logo-img { height: 135px; }
}

@media (max-width: 480px) {
  .logo-img { height: 105px; }
}

/* ==============================================
   GLAVNI MENI
   ============================================== */

.main-menu {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 360px;
  max-height: 100%;
  overflow: hidden;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  padding: 4px 4px 4px 16px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-align: left;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.menu-item .menu-text {
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.menu-item:hover {
  color: white;
  border-left-color: var(--rust-red);
  padding-left: 24px;
}

.menu-item.primary {
  color: white;
}

.menu-item.primary .menu-text {
  background: linear-gradient(135deg, var(--rust-red) 0%, var(--rust-red-hover) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: bold;
}

.menu-item.primary:hover .menu-text {
  background: linear-gradient(135deg, #ff5a3d 0%, #ff7a5c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-hint {
  font-family: 'Inter', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  background: rgba(0,0,0,0.5);
  padding: 3px 8px;
  border-radius: 3px;
  margin-left: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.menu-item:hover .menu-hint { opacity: 1; }

.badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--rust-red);
  color: white;
  padding: 3px 8px;
  border-radius: 2px;
  margin-left: 12px;
  text-shadow: none;
  box-shadow: 0 2px 6px rgba(205,65,43,0.5);
}

.menu-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--text-dim), transparent);
  margin: 10px 0;
  width: 80%;
}

/* ==============================================
   MESSAGES PANEL (gore desno)
   ============================================== */

.messages-panel {
  grid-column: 2;
  grid-row: 1;
  width: 420px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.messages-header {
  background: var(--rust-red);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.messages-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 4px;
  color: white;
  font-weight: normal;
}

.messages-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(40, 80, 40, 0.25);
  border: 1px solid rgba(80, 160, 80, 0.4);
  font-size: 13px;
  line-height: 1.4;
}

.message-item:nth-child(2) {
  background: rgba(120, 80, 30, 0.25);
  border-color: rgba(200, 140, 50, 0.4);
}

.message-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
}

.message-icon.ok { background: #4a9a4a; color: white; }
.message-icon.warn { background: #c8853e; color: white; }

.message-content { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.msg-strong { color: #b8e6b8; font-weight: 600; }
.message-item:nth-child(2) .msg-strong { color: #f0c894; }
.msg-text { color: var(--text-muted); }

.msg-countdown {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 3px;
  color: white;
  line-height: 1;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(205,65,43,0.4);
}

/* ==============================================
   STATUS BAR (dole)
   ============================================== */

.status-bar {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  gap: 32px;
  align-items: center;
  padding: 12px 16px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  letter-spacing: 1px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-label {
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
}

.status-value {
  color: var(--text-primary);
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #888;
}

.status-dot.online {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

#server-ip {
  font-family: 'SF Mono', 'Menlo', monospace;
  background: rgba(0,0,0,0.5);
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}

#server-ip:hover { background: rgba(205,65,43,0.3); }

.sound-toggle {
  margin-left: auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--text-dim);
  color: var(--text-muted);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}

.sound-toggle:hover {
  border-color: var(--rust-red);
  color: var(--rust-red);
}

/* ==============================================
   SIDEBAR IKONE (desno, vertikalno)
   ============================================== */

.sidebar-icons {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  justify-self: end;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  color: var(--text-muted);
  border-radius: 4px;
  transition: all 0.15s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

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

.icon-btn:hover {
  background: var(--rust-red);
  color: white;
  transform: scale(1.1);
}

/* ==============================================
   MODAL
   ============================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-backdrop[hidden] { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  position: relative;
  width: min(640px, 90vw);
  max-height: 80vh;
  overflow: auto;
  background: #14110f;
  border: 1px solid var(--panel-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: transparent;
  border: none;
  color: white;
  font-size: 28px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--rust-red); }

.modal-body { padding: 0; }

.modal-header {
  background: var(--rust-red);
  padding: 16px 20px;
}

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 3px;
  color: white;
  font-weight: normal;
}

.modal-content {
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.modal-content h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--rust-red);
  margin: 20px 0 8px;
  font-weight: normal;
}

.modal-content h3:first-child { margin-top: 0; }
.modal-content p { margin-bottom: 12px; color: var(--text-muted); }
.modal-content ul { margin: 8px 0 16px 20px; color: var(--text-muted); }
.modal-content li { margin-bottom: 6px; }
.modal-content strong { color: var(--text-primary); }
.modal-content code {
  background: #000;
  color: var(--rust-red);
  padding: 2px 8px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  border-radius: 2px;
}

.connect-box {
  background: #000;
  border: 1px solid var(--rust-red);
  padding: 16px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.connect-box code {
  background: transparent;
  padding: 0;
  font-size: 16px;
  flex: 1;
  word-break: break-all;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rust-red);
  color: white;
  border: none;
  padding: 10px 20px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: var(--rust-red-hover); }
.btn.secondary { background: transparent; border: 1px solid var(--rust-red); }
.btn.secondary:hover { background: var(--rust-red); }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.team-card {
  background: #0a0908;
  border: 1px solid #2a2520;
  padding: 12px;
  text-align: center;
}

.team-name { font-weight: 700; color: white; }
.team-role {
  font-size: 11px;
  color: var(--rust-red);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ==============================================
   TOAST
   ============================================== */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1612;
  border: 1px solid var(--rust-red);
  color: white;
  padding: 12px 24px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 2px;
  box-shadow: var(--shadow-strong);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 900px) {
  html, body { overflow: auto; }

  .lobby {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    padding: 16px;
    height: auto;
    min-height: 100vh;
  }

  .messages-panel {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  .main-menu {
    grid-row: 3;
    align-self: start;
  }

  .menu-item { font-size: 32px; }

  .logo-rust { font-size: 40px; }

  .sidebar-icons {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
    flex-direction: row;
    justify-content: center;
    margin: 8px 0 16px;
  }

  .status-bar {
    flex-wrap: wrap;
    gap: 16px;
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .menu-item { font-size: 26px; letter-spacing: 2px; }
  .menu-hint { display: none; }
  .messages-header h2 { font-size: 18px; }
}
