/* New Mobile-First Design */
/* Designed for one-handed smartphone use */

:root {
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-primary: #4A90E2;
  --color-primary-dark: #357ABD;
  --color-danger: #E33244;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --nav-height: 56px;
  --header-height: 56px;
  --player-height: 80px;
  --spacing-unit: 1rem;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--color-surface);
  color: var(--color-text);
  margin: 0;
  min-height: 100vh;
}

#background-visualization-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-bar {
  height: var(--header-height);
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.top-bar .title {
  font-size: 1.25rem;
  font-weight: 600;
}

#content-area {
  flex: 1;
  padding: var(--spacing-unit);
  overflow-y: auto;
  padding-bottom: calc(var(--nav-height) + var(--player-height) + var(--spacing-unit));
}

.view {
  display: none;
  flex-direction: column;
  align-items: center;
}

.view.active-view {
  display: flex;
}

.timer-container {
  font-size: 2rem;
  margin-bottom: var(--spacing-unit);
}

.waveform-container {
  width: 100%;
  max-width: 500px;
  height: 80px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  margin-bottom: var(--spacing-unit);
  position: relative;
  overflow: hidden;
}

.controls {
  display: flex;
  gap: var(--spacing-unit);
}

.control-button {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: background-color 0.2s, transform 0.1s;
  cursor: pointer;
}

.control-button.pause {
  background-color: var(--color-primary-dark);
}

.control-button.stop {
  background-color: var(--color-danger);
}

.control-button svg {
  width: 24px;
  height: 24px;
}

.control-button:active {
  transform: scale(0.95);
}

#recordings-list-view #recordings-list {
  list-style: none;
  width: 100%;
  max-width: 600px;
}

#recordings-list-view #recordings-list li {
  background-color: var(--color-bg);
  border: 1px solid var(--color-text-muted);
  border-radius: 8px;
  padding: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.recording-info {
  flex: 1 1 auto;
  margin-right: var(--spacing-unit);
  overflow: hidden;
}

.recording-name {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recording-details {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.recording-controls {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

#recordings-list-view .recording-controls button {
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.1s;
  cursor: pointer;
}

#recordings-list-view .recording-controls button.delete-button {
  background-color: var(--color-danger);
}

#recordings-list-view .recording-controls button.share-button {
  background-color: var(--color-primary-dark);
}

#recordings-list-view .recording-controls button:active {
  transform: scale(0.95);
}

.setting-item {
  width: 100%;
  max-width: 400px;
  margin-bottom: var(--spacing-unit);
}

.setting-item label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.setting-item select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-text-muted);
  border-radius: 4px;
  font-size: 1rem;
}

#audio-player-container {
  display: none;
  position: fixed;
  bottom: var(--nav-height);
  left: 0;
  right: 0;
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-text-muted);
  padding: 0.5rem 1rem;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
  z-index: 10;
  flex-direction: column;
}

#audio-player-container .playback-waveform-container {
  width: 100%;
  height: 40px;
  background-color: var(--color-surface);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

#audio-player-container audio {
  width: 100%;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-text-muted);
  display: flex;
  box-shadow: 0 -1px 2px rgba(0,0,0,0.1);
}

.nav-button {
  flex: 1;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s;
}

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

.nav-button:hover {
  color: var(--color-primary);
}
/* Install button for PWA */
.install-button {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--spacing-unit));
  right: var(--spacing-unit);
  padding: 0.75rem 1rem;
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  font-size: 1rem;
  cursor: pointer;
  z-index: 1000;
}
