:root {
  --bg-color: #f2f4f6;
  --surface-color: #ffffff;
  --primary-color: #2d3436;
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --accent-color: #50c878;
  --danger-color: #ff7675;
  --warning-color: #fdcb6e;
  --info-color: #09b77f;
  --success-color: #98ff98;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
  --font-main: "Poppins", sans-serif;
  --font-title: "Coolvetica", "Poppins", sans-serif;
  --font-subtitle: "Supreme", "Poppins", sans-serif;
  --bg-shadown: rgba(45, 52, 54, 0.3);
}

@font-face {
  font-family: "Coolvetica";
  src: url("font/coolvetica_Rg.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Supreme";
  src: url("fonts/Supreme-Italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
}

body.dark-mode {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --primary-color: #ffffff;
  --text-primary: #f5f6fa;
  --text-secondary: #b2bec3;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
  --bg-shadown: rgba(227, 242, 247, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  transition: background-color 0.3s, color 0.3s;
}

svg {
  color: var(--text-primary);
}

/* Splash styles (kept as fallback or shared) */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease-out;
}

.splash-content {
  text-align: center;
  animation: fadeIn 1s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
}

.splash-content h1 {
  font-family: var(--font-title);
  font-size: 5rem;
  color: var(--primary-color);
  letter-spacing: 1px;
  margin-bottom: 5px;
  line-height: 1;
}

.splash-content .subtitle {
  font-family: var(--font-subtitle);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-secondary);
  text-transform: lowercase;
  letter-spacing: 1px;
  font-weight: 400;
}

/* Shared Buttons */
.primary-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 16px 80px;
  border-radius: 30px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  animation: fadeIn 0.5s ease;
}

.hidden-btn {
  display: none;
}

/* App Container & Header */
.app-container {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-color);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: fadeIn 0.5s ease;
}

header {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-title);
  font-weight: normal;
  font-size: 1.8rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

.status-indicator {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background-color: #dfe6e9;
  color: var(--text-secondary);
}

.status-indicator.active {
  background-color: rgba(0, 184, 148, 0.15);
  color: var(--success-color);
}

main.view {
  flex: 1;
  padding: 24px;
  display: none;
  overflow-y: auto;
  flex-direction: column;
  padding-bottom: 120px;
  animation: fadeIn 0.3s ease;
}

main.view.active {
  display: flex;
}

#view-history {
  overflow-y: hidden;
  padding-bottom: 0;
}

/* Monitor / Visualizer Styles */
.monitor-card {
  background-color: var(--surface-color);
  border-radius: 32px;
  padding: 40px 20px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.visualizer-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
}

.power-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background-color: var(--primary-color);
  color: var(--bg-color);
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px var(--bg-shadown);
}

.power-btn.active {
  background-color: var(--accent-color);
  box-shadow: 0 10px 20px var(--success-color);
}

.wave-circle {
  position: absolute;
  border-radius: 50%;
  background-color: var(--accent-color);
  opacity: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.listening .wave-circle {
  animation: pulseWave 2s infinite;
}

#wave-1 {
  width: 100px;
  height: 100px;
  animation-delay: 0s;
}

#wave-2 {
  width: 140px;
  height: 140px;
  animation-delay: 0.4s;
}

#wave-3 {
  width: 180px;
  height: 180px;
  animation-delay: 0.8s;
}

.status-text h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.status-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.sensitivity-control {
  background-color: var(--surface-color);
  padding: 20px;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
}

.sensitivity-control label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: #dfe6e9;
  border-radius: 5px;
  appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 206, 201, 0.4);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

#clear-history {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: var(--font-main);
  cursor: pointer;
  text-decoration: underline;
}

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 120px;
}

.notification-card {
  background-color: var(--surface-color);
  padding: 16px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  border-left: 5px solid transparent;
}

.notif-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.notif-content {
  flex: 1;
}

.notif-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.notif-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.type-danger {
  border-left-color: var(--danger-color);
}

.type-danger .notif-icon {
  background-color: rgba(255, 118, 117, 0.15);
  color: var(--danger-color);
}

.type-warning {
  border-left-color: var(--warning-color);
}

.type-warning .notif-icon {
  background-color: rgba(253, 203, 110, 0.15);
  color: #e17055;
}

.type-info {
  border-left-color: var(--info-color);
}

.type-info .notif-icon {
  background-color: rgba(116, 185, 255, 0.15);
  color: var(--info-color);
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 50px;
  opacity: 0.6;
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 10px;
}

.settings-list {
  background-color: var(--surface-color);
  border-radius: 20px;
  padding: 10px 0;
  box-shadow: var(--shadow-soft);
  margin-top: 20px;
}

.setting-item {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bg-color);
  transition: background 0.2s;
}

.setting-item:last-child {
  border-bottom: none;
}

.click-item {
  cursor: pointer;
}

.click-item:active {
  opacity: 0.7;
}

.setting-info {
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 500;
}

.setting-icon {
  width: 36px;
  height: 36px;
  background-color: var(--bg-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.arrow-indicator {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.danger-text {
  color: var(--danger-color);
}

.danger-text .setting-icon {
  color: var(--danger-color);
  background: rgba(255, 118, 117, 0.1);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.app-legend {
  text-align: center;
  margin-top: 40px;
  color: var(--text-secondary);
  opacity: 0.7;
}

.app-legend p {
  font-style: italic;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 5000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s;
}

.modal-card {
  background-color: var(--surface-color);
  padding: 30px;
  border-radius: 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.modal-icon.warning {
  color: var(--warning-color);
}

.modal-card h3 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.modal-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 25px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.secondary-btn {
  background: var(--bg-color);
  color: var(--text-primary);
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.danger-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.bottom-nav {
  background-color: var(--surface-color);
  padding: 15px 30px;
  display: flex;
  justify-content: space-around;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: #b2bec3;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.7rem;
}

.nav-item i {
  font-size: 1.3rem;
}

.nav-item.active {
  color: var(--accent-color);
}

.alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--danger-color);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  padding: 40px;
  text-align: center;
}

.alert-overlay.type-warning {
  background-color: #e17055;
}

.alert-overlay.type-info {
  background-color: var(--info-color);
}

.alert-icon-container {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: shake 0.5s infinite;
}

#alert-title {
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

#dismiss-btn {
  margin-top: 40px;
  padding: 15px 40px;
  background-color: white;
  color: var(--danger-color);
  border: none;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.vibration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  animation: vibrationFlash 0.2s infinite;
}

.vibration-content {
  text-align: center;
}

.vibration-icon {
  font-size: 5rem;
  margin-bottom: 20px;
  animation: shake 0.5s infinite;
}

@keyframes vibrationFlash {
  0% {
    background-color: rgba(0, 0, 0, 0.9);
  }
  50% {
    background-color: rgba(45, 52, 54, 0.9);
  }
  100% {
    background-color: rgba(0, 0, 0, 0.9);
  }
}

@keyframes pulseWave {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shake {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(10deg);
  }
  75% {
    transform: rotate(-10deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.hidden {
  display: none !important;
}
