/* ==========================================
   FIXIT CORE | 3D BLOCK BACKGROUND WIKI THEME
   ========================================== */

:root {
  --bg-overlay: linear-gradient(160deg, rgba(6, 7, 12, 0.85) 0%, rgba(17, 9, 32, 0.88) 60%, rgba(9, 5, 20, 0.92) 100%);
  --bg-card: rgba(19, 16, 36, 0.82);
  --bg-input: #120e24;
  --bg-sidebar: rgba(13, 10, 26, 0.85);
  --border-color: #272042;
  --border-subtle: #1c1730;
  --text-main: #f1f3f9;
  --text-muted: #9ca3af;
  --text-dim: #635f75;
  --accent-purple: #9d5cff;
  --accent-blue: #4f80ff;
  --accent-glow: rgba(157, 92, 255, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: #0b0817;
  background-image: linear-gradient(160deg, rgba(6, 7, 12, 0.75) 0%, rgba(17, 9, 32, 0.8) 60%, rgba(9, 5, 20, 0.85) 100%), url('images/background.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
  color: var(--text-main);
  padding: 24px;
  min-height: 100vh;
  line-height: 1.6;
}

/* ==========================================
   BANNER CONTAINER
   ========================================== */
.banner-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto 18px auto;
}

.site-banner {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  opacity: 0.9;
  filter: contrast(105%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   NAVIGATION BAR
   ========================================== */
.site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 1280px;
  margin: 0 auto 32px auto;
  padding: 10px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 5px;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.site-nav a:hover {
  color: var(--text-main);
  background: var(--bg-input);
}

.site-nav a.active {
  color: #fff;
  background: var(--border-color);
  border: 1px solid rgba(157, 92, 255, 0.4);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ==========================================
   HEADER
   ========================================== */
header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* ==========================================
   WIKI LAYOUT GRID
   ========================================== */
.wiki-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
}

.wiki-sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.sidebar-links a:hover {
  color: var(--accent-purple);
}

/* ==========================================
   WIKI CARDS & TABLES
   ========================================== */
.wiki-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.wiki-section-header {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  overflow-x: auto;
}

.guide-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 18px;
  border: 1px solid var(--border-subtle);
}

.guide-card h3 {
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 14px;
}

.guide-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-card ul li {
  position: relative;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.guide-card ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  background-color: var(--accent-purple);
  border-radius: 50%;
}

.guide-card ol {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-card li strong {
  color: var(--text-main);
}

code {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: 4px;
  color: #c4b5fd;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.82rem;
}

/* ==========================================
   FLOATING SUPPORT CHAT WIDGET
   ========================================== */
.chat-widget-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.chat-toggle-btn {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 10px 18px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.chat-toggle-btn:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px var(--accent-glow);
}

.chat-popup-panel {
  position: absolute;
  bottom: 55px;
  right: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 460px;
  background: rgba(13, 10, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  display: none;
}

.chat-header {
  background: var(--bg-input);
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.chat-header button.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
}

.channel-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.channel-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: 4px;
  cursor: pointer;
}

.channel-btn.active {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
}

.chat-messages {
  position: absolute;
  top: 85px;
  bottom: 60px;
  left: 0;
  right: 0;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-sidebar);
}

.message {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
}

.message .author {
  color: var(--accent-purple);
  font-weight: 600;
  margin-right: 6px;
}

.chat-input-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input-area textarea {
  flex: 1;
  height: 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 8px;
  color: var(--text-main);
  font-size: 0.8rem;
  resize: none;
}

.chat-input-area button {
  background: var(--accent-purple);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */
@media (max-width: 900px) {
  body {
    padding: 12px;
  }

  .wiki-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .wiki-sidebar {
    position: static;
    margin-bottom: 8px;
  }

  header h1 {
    font-size: 1.7rem;
  }

  header p {
    font-size: 0.8rem;
  }

  .site-nav {
    gap: 4px;
    padding: 8px;
  }

  .site-nav a {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  .guide-card {
    padding: 16px;
  }

  .chat-popup-panel {
    width: calc(100vw - 24px);
    right: -12px;
    bottom: 50px;
    height: 400px;
  }
}