/* =============================================
   PULSEROOM — GLOBAL DESIGN SYSTEM
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #05070A;
  --bg-navy: #0A0D1A;
  --primary: #00F2FF;
  --secondary: #FFD700;
  --accent: #FF00FF;
  --purple: #8B5CF6;
  --red: #FF3333;
  --blue: #4488FF;
  --yellow: #FFFF00;
  --grey: #888888;
  --glass-bg: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.1);
  --glass-blur: blur(20px);
  --radius-card: 24px;
  --radius-pill: 50px;
  --transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: all 0.2s ease;
  --mood-color: #8B5CF6;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at center, #0d0d1a 0%, #000 100%);
}

#mobile-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
}

#mobile-wrapper.fullscreen-web {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

@media (min-width: 480px) and (min-height: 650px) {
  #mobile-wrapper {
    width: 390px;
    height: 844px;
    border-radius: 48px;
    box-shadow: 0 0 0 12px #1c1d24, 0 0 0 13px rgba(255,255,255,0.08), 0 30px 100px rgba(0,0,0,0.9);
  }
}

/* Floating view mode switch when in fullscreen web mode */
.fullscreen-toggle-back {
  position: absolute;
  top: 60px;
  right: 24px;
  z-index: 10000;
  display: none;
  background: rgba(5, 7, 10, 0.7);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 18px;
  border-radius: 50px;
  color: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transition: var(--transition-fast);
}

.fullscreen-toggle-back svg {
  stroke-width: 2.5px;
}

.fullscreen-toggle-back:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0,242,255,0.4);
}

.fullscreen-web .fullscreen-toggle-back {
  display: flex;
}

/* Desktop Side Panel */
.desktop-panel {
  display: none;
  width: 300px;
  padding: 30px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
  z-index: 1;
}

/* Display desktop panel side-by-side on larger screens */
@media (min-width: 900px) {
  .desktop-panel {
    display: flex;
    margin-right: 40px;
  }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vibe-orb {
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
  animation: pulseGlow 2s infinite ease-in-out;
}

.panel-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fff 0%, #888 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.panel-tag {
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 242, 255, 0.15);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(0, 242, 255, 0.2);
  text-transform: uppercase;
}

.panel-subtitle {
  font-size: 13px;
  color: #a0aec0;
  line-height: 1.5;
}

.panel-divider {
  height: 1px;
  background: linear-gradient(to right, rgba(255,255,255,0.08), rgba(255,255,255,0));
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-section label {
  font-size: 11px;
  font-weight: 700;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.panel-desc {
  font-size: 12px;
  color: #a0aec0;
  line-height: 1.4;
  margin-bottom: 5px;
}

.view-mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 12px 16px;
  border-radius: 16px;
  color: #e2e8f0;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.view-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: white;
}

.view-btn.active {
  background: rgba(0, 242, 255, 0.08);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 15px rgba(0,242,255,0.15);
}

.apk-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--purple) 0%, #6d28d9 100%);
  border: none;
  padding: 14px 20px;
  border-radius: 18px;
  color: white;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.3);
  transition: var(--transition);
}

.apk-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(139, 92, 246, 0.45);
}

.panel-footer {
  font-size: 11px;
  color: #4a5568;
  text-align: center;
  margin-top: 10px;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 15px var(--primary); }
}

/* Status Bar */
#status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  pointer-events: none;
}

.fullscreen-web #status-bar {
  display: none !important;
}

.status-time {
  font-size: 15px;
  font-weight: 600;
  color: white;
  letter-spacing: -0.3px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Screen Container */
#screen-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: none;
}

.screen::-webkit-scrollbar { display: none; }

.screen.active {
  display: block;
}

/* Glassmorphism */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.glass-dark {
  background: rgba(5, 7, 10, 0.7);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* Bottom Nav */
#bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(5, 7, 10, 0.85);
  border-top: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 900;
  padding-bottom: 8px;
}

.nav-items {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100%;
  padding: 8px 0 4px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: var(--transition-fast);
  padding: 4px 8px;
  position: relative;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--primary);
}

.nav-icon {
  width: 24px;
  height: 24px;
}

.nav-create {
  color: rgba(255,255,255,0.4) !important;
}

.create-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0,242,255,0.4);
  margin-top: -16px;
}

.create-btn svg {
  width: 22px;
  height: 22px;
  color: white;
}

/* Buttons */
.btn-pill {
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-pill:active {
  transform: scale(0.95);
}

.btn-glass {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  backdrop-filter: blur(20px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 30px rgba(0,242,255,0.3);
}

.btn-gold {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #000;
  font-weight: 700;
}

.btn-purple-gold {
  background: linear-gradient(135deg, var(--secondary), #FF6B9D, var(--purple));
  color: #000;
  font-weight: 700;
}

/* Particle canvas */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

/* Toast */
.toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: rgba(5, 7, 10, 0.9);
  border: 1px solid var(--secondary);
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 14px;
  color: white;
  backdrop-filter: blur(20px);
  z-index: 2000;
  white-space: nowrap;
  box-shadow: 0 0 20px rgba(255,215,0,0.3);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

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

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Action Sheet */
.action-sheet {
  position: absolute;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: flex-end;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.sheet-content {
  position: relative;
  width: 100%;
  background: rgba(15,17,25,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px 28px 0 0;
  padding: 12px 20px 40px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1);
  backdrop-filter: blur(30px);
}

.action-sheet.show .sheet-content {
  transform: translateY(0);
}

.action-sheet.hidden {
  display: none;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.sheet-content h3 {
  font-size: 20px;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
  text-align: center;
}

.sheet-btn {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.2s;
}

.sheet-btn:active { background: rgba(255,255,255,0.1); }

.sheet-btn-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
}

.sheet-btn-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
  text-align: left;
}

.sheet-btn-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-align: left;
  margin-top: 2px;
}

.sheet-cancel {
  width: 100%;
  padding: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  font-family: 'Inter', sans-serif;
}

/* Utility */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }

/* Scrollable area within screen with bottom nav */
.screen-scroll {
  padding-top: 44px;
  padding-bottom: 90px;
  min-height: 100%;
}

/* Card */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  backdrop-filter: var(--glass-blur);
}

/* Glow orb */
.glow-orb {
  border-radius: 50%;
  animation: breathe 3s ease-in-out infinite;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.section-link {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

/* Avatar circle */
.avatar-circle {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

/* Animated ring border */
.rainbow-ring {
  background: conic-gradient(from 0deg, #00F2FF, #8B5CF6, #FF00FF, #FFD700, #00F2FF);
  padding: 3px;
  border-radius: 50%;
  animation: ringRotate 4s linear infinite;
}

.rainbow-ring-inner {
  background: #0d0f1a;
  border-radius: 50%;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

@keyframes ringRotate {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}

/* Waveform animation */
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

.wave-bar {
  width: 3px;
  border-radius: 2px;
  animation: waveAnim 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; height: 8px; }
.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 16px; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 12px; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; height: 20px; }
.wave-bar:nth-child(5) { animation-delay: 0.3s; height: 10px; }

@keyframes waveAnim {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.5); }
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 28px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 50px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: 0 0 12px rgba(0,242,255,0.4);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Custom range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0,242,255,0.6), 0 2px 8px rgba(0,0,0,0.4);
  transition: box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 20px rgba(0,242,255,0.9), 0 2px 8px rgba(0,0,0,0.4);
}
