@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: dark;
  color: #f4f4f5;
  background-color: #05020c;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Theme variables */
  --bg-main: #05020c;
  --bg-gradient: radial-gradient(circle at 50% -20%, #1c0e35 0%, #05020c 70%);
  --bg-panel: rgba(15, 10, 25, 0.55);
  --bg-panel-hover: rgba(25, 18, 40, 0.7);
  --border-color: rgba(139, 92, 246, 0.15);
  --border-color-glow: rgba(139, 92, 246, 0.4);
  
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.5);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.5);
  --accent-pink: #ec4899;
  --accent-pink-glow: rgba(236, 72, 153, 0.5);

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
}

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

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.6);
}

/* Auth Page Containers */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.glass-card {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 
              0 0 50px rgba(139, 92, 246, 0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-color-glow);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 
              0 0 60px rgba(139, 92, 246, 0.1);
}

/* Alert Boxes */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  color: #f87171;
}
.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  color: #34d399;
}

/* Typography & Logo */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
}

.logo-text {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.logo-icon {
  color: var(--accent-purple);
  filter: drop-shadow(0 0 8px var(--accent-purple));
}

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Form inputs */
.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, #6d28d9 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-purple);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

/* App Layout Grid */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  height: 70px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 5, 20, 0.4);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--accent-purple);
  color: #d8b4fe;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-moderator {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: #99f6e4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 70px);
}

/* Sidebar List */
.sidebar {
  width: 280px;
  border-right: 1px solid var(--border-color);
  background: rgba(10, 5, 20, 0.2);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 20px;
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.soundboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.soundboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.soundboard-item:hover {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.1);
}

.soundboard-item.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--border-color-glow);
  box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.1);
}

.soundboard-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.soundboard-item-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Center Dashboard Console */
.dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 30px;
  overflow-y: auto;
  gap: 24px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

/* Soundpad Grid */
.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.soundpad {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.soundpad::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.soundpad:hover {
  transform: translateY(-4px);
  border-color: var(--accent-purple-glow);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15), 
              0 0 15px rgba(139, 92, 246, 0.05);
}

.soundpad:hover::before {
  opacity: 1;
}

.soundpad.playing {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px var(--accent-cyan-glow);
  animation: pulse-glow 1.5s infinite alternate;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  }
  100% {
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
  }
}

.soundpad-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-purple);
  transition: all 0.2s ease;
  z-index: 1;
}

.soundpad:hover .soundpad-btn {
  background: var(--accent-purple);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 0 15px var(--accent-purple-glow);
}

.soundpad.playing .soundpad-btn {
  background: var(--accent-cyan);
  color: white;
  box-shadow: 0 0 15px var(--accent-cyan-glow);
}

.soundpad-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-align: center;
  z-index: 1;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.soundpad-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  z-index: 10;
  padding: 4px;
}

.soundpad:hover .soundpad-delete {
  opacity: 1;
}

.soundpad-delete:hover {
  color: #ef4444;
}

/* Control Panel (Right Sidebar) */
.control-panel {
  width: 320px;
  border-left: 1px solid var(--border-color);
  background: rgba(10, 5, 20, 0.35);
  backdrop-filter: blur(8px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.panel-section:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Volume Slider styling */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-purple);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-purple-glow);
  transition: all 0.1s ease;
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--text-primary);
}

/* Switches & Toggles */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 22px;
  border: 1px solid var(--border-color);
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-switch {
  background-color: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-purple);
}

input:checked + .slider-switch:before {
  transform: translateX(22px);
  background-color: var(--accent-purple);
  box-shadow: 0 0 8px var(--accent-purple-glow);
}

/* Visualizer Area */
.visualizer-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 12px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.visualizer-canvas {
  width: 100%;
  height: 100%;
  background: transparent;
}

/* Device Selector */
.select-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
  cursor: pointer;
}

.select-input:focus {
  border-color: var(--accent-purple);
}

/* Share modal & checklist */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #0f0a1c;
  border: 1px solid var(--border-color-glow);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 
              0 0 50px rgba(139, 92, 246, 0.15);
  width: 100%;
  max-width: 500px;
  padding: 30px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.users-checklist {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.user-checkbox-label:hover {
  background: rgba(139, 92, 246, 0.1);
}

.checkbox-input {
  accent-color: var(--accent-purple);
}

/* Moderator Panel Styles */
.mod-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mod-table-container {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.mod-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.mod-table th {
  background: rgba(139, 92, 246, 0.05);
  padding: 14px 20px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.mod-table td {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 0.95rem;
  vertical-align: middle;
}

.mod-table tr:last-child td {
  border-bottom: none;
}

.mod-table tr:hover td {
  background: rgba(139, 92, 246, 0.02);
}

.access-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.access-allowed {
  color: #10b981;
}

.access-denied {
  color: var(--text-muted);
}

/* Tabs */
.tabs-container {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1px;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  padding: 12px 16px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--accent-purple);
  border-color: var(--accent-purple);
}

/* Tutorial / Routing guide */
.guide-box {
  background: rgba(6, 182, 212, 0.04);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  padding: 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-box ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-box code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-family: monospace;
}

/* Audio visual animation trigger */
.ripple {
  position: absolute;
  border: 2px solid var(--accent-cyan-glow);
  border-radius: 50%;
  animation: ripple-effect 0.6s ease-out;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

@keyframes ripple-effect {
  0% {
    width: 0px;
    height: 0px;
    opacity: 1;
  }
  100% {
    width: 250px;
    height: 250px;
    opacity: 0;
  }
}
