/* ==========================================================================
   Discordia CORE STYLESHEET
   Aesthetic: Obsidian, High-Grade Violet, Precision Glassmorphism & Cyber Minimal
   ========================================================================== */

:root {
  --bg-deep: #07060a;
  --bg-surface: #0e0c15;
  --bg-panel: rgba(19, 16, 29, 0.78);
  --bg-card: rgba(26, 22, 40, 0.65);
  --border-subtle: rgba(168, 85, 247, 0.16);
  --border-active: rgba(192, 132, 252, 0.45);
  --border-glow: #a855f7;
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-light: #c084fc;
  --accent: #06b6d4;
  --danger: #f43f5e;
  --success: #10b981;
  --warning: #f59e0b;

  --text-main: #f1f0f7;
  --text-muted: #8b88a5;
  --text-dim: #5c5875;

  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  --shadow-purple: 0 0 25px rgba(139, 92, 246, 0.22);
  --shadow-neon: 0 8px 32px 0 rgba(0, 0, 0, 0.55);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #07060a 0%, #0d0b14 100%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Animated Matrix Grid Lines */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

/* Header & Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 8, 17, 0.82);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #7c3aed, #06b6d4);
  border-radius: 9px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
}

.brand-logo-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(120deg, #fff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Container & Layout */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
  flex: 1;
}

/* Landing Page Hero */
.hero-section {
  text-align: center;
  margin: 2.5rem 0 3.5rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.hero-title span {
  background: linear-gradient(135deg, #c084fc 0%, #a855f7 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Action Cards Matrix */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

/* Custom UI Glassmorphism Card (UIverse Inspired) */
.glass-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-neon);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.glass-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.glass-box:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.18);
}

.glass-box:hover::before {
  opacity: 1;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  display: grid;
  place-items: center;
  color: var(--primary-light);
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #fff;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Form Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.input-Discordia {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: rgba(14, 11, 23, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.25s ease;
}

.input-Discordia:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
  background: rgba(17, 13, 29, 0.95);
}

/* UIverse Inspired Cyber Button */
.btn-Discordia {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
  text-decoration: none;
}

.btn-Discordia:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

.btn-Discordia:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-active);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Room Layout (Meet / Discord Style) */
.room-wrapper {
  display: flex;
  height: calc(100vh - 65px);
  position: relative;
  overflow: hidden;
}

.meeting-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: radial-gradient(circle at center, #120f1e 0%, #07060a 100%);
  position: relative;
  overflow: hidden;
}

.video-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
  align-content: center;
  justify-content: center;
  overflow-y: auto;
  padding-bottom: 80px;
}

/* Video Card Stream Tile */
.video-tile {
  background: #0f0d19;
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s ease;
}

.video-tile.speaking {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.video-tile.screen-tile {
  grid-column: 1 / -1;
  max-height: 70vh;
  border-color: var(--accent);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.25);
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.video-tile.screen-tile .video-element {
  object-fit: contain;
}

.avatar-fallback {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6d28d9, #4c1d95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--border-glow);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.tile-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(10, 8, 17, 0.85);
  backdrop-filter: blur(8px);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
}

.tile-status-icons {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.status-icon-pill {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}

.status-icon-pill.off {
  color: var(--danger);
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

/* Control Dock (Floating Discord/Meet Style Bottom Bar) */
.control-dock {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 13, 26, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 8px 18px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  z-index: 50;
}

.dock-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dock-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.dock-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--primary-light);
  transform: scale(1.08);
}

.dock-btn.active {
  background: var(--primary);
  border-color: var(--primary-light);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.6);
}

.dock-btn.danger-leave {
  background: var(--danger);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.dock-btn.danger-leave:hover {
  background: #e11d48;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.6);
}

.dock-btn.muted-active {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

/* Sidebar Chat (Discord Style) */
.sidebar-chat {
  width: 360px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-chat.hidden {
  display: none;
}

.chat-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.msg-bubble {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.msg-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  display: flex;
  gap: 8px;
}

.msg-meta .author {
  color: var(--primary-light);
  font-weight: 600;
}

.msg-body {
  background: rgba(25, 21, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-break: break-word;
}

.msg-body.self {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.35);
}

.chat-input-bar {
  padding: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 460px;
  background: #110e1b;
  border: 1px solid var(--border-active);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 1.75rem;
}

/* Toast Notification */
.Discordia-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(19, 16, 29, 0.95);
  border: 1px solid var(--border-glow);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  font-size: 0.88rem;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.Discordia-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .room-wrapper {
    flex-direction: column;
  }
  .sidebar-chat {
    width: 100%;
    height: 45vh;
  }
  .hero-title {
    font-size: 2.3rem;
  }
}
