/* CrateQuiet Styles – Phase 1 */
:root {
  --bg: #181A20;
  --card: #23243A;
  --primary: #00EAFF;
  --secondary-gradient: linear-gradient(90deg, #A18FFF 0%, #6F6FFF 100%);
  --text: #FFFFFF;
  --error: #FF4D4F;
  --footer: #888;
  --mono: 'Source Code Pro', monospace;
  --heading: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  --body: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s;
}
.splash-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--card);
  padding: 24px;
  box-shadow: 0 4px 32px #0008;
}

.hidden { display: none; }

main {
  width: 100vw;
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px 0 16px;
  box-sizing: border-box;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  text-align: center;
  margin-bottom: 24px;
}
.screen-title {
  font-family: var(--heading);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px 0;
}

.record-section {
  background: var(--card);
  border-radius: 24px;
  padding: 32px 16px;
  width: 100%;
  box-shadow: 0 2px 16px #0004;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.icon {
  width: 36px;
  height: 36px;
  fill: currentColor;
}
.prompt {
  font-size: 16px;
  margin-bottom: 24px;
  text-align: center;
}
.primary-btn {
  width: 100%;
  height: 44px;
  background: var(--primary);
  color: var(--bg);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-family: var(--heading);
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.primary-btn:hover, .primary-btn:focus {
  background: var(--secondary-gradient);
  color: var(--text);
}
.secondary-btn {
  width: 100%;
  height: 44px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 12px;
  font-size: 16px;
  font-family: var(--heading);
  font-weight: 600;
  margin-bottom: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.status-msg {
  min-height: 24px;
  font-size: 14px;
  margin-top: 8px;
  color: var(--primary);
  text-align: center;
}
.footer {
  color: var(--footer);
  font-size: 12px;
  text-align: center;
  margin-top: 48px;
  width: 100%;
}

.tab-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  background: var(--card);
  border-radius: 16px;
  margin-bottom: 24px;
  padding: 8px 0;
}
.tab-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: background 0.2s;
}
.tab-btn[aria-current="page"] {
  background: var(--primary);
}
.tab-btn img {
  width: 24px;
  height: 24px;
  filter: invert(1);
}
.log-section {
  background: var(--card);
  border-radius: 24px;
  padding: 32px 16px;
  width: 100%;
  box-shadow: 0 2px 16px #0004;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 320px;
}
.log-list {
  width: 100%;
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 16px;
}
.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #23243A;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
}
.log-item .log-time {
  font-weight: 600;
  margin-right: 12px;
}
.log-item .log-action {
  display: flex;
  align-items: center;
  gap: 8px;
}
.log-empty {
  color: #aaa;
  font-size: 15px;
  text-align: center;
  margin-top: 24px;
}
.log-play-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.log-play-btn:hover, .log-play-btn:focus {
  background: var(--secondary-gradient);
  color: var(--text);
}
.monitor-section {
  background: var(--card);
  border-radius: 24px;
  padding: 32px 16px;
  width: 100%;
  box-shadow: 0 2px 16px #0004;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.monitor-section.vibrating {
  animation: vibrate-bg 0.4s linear;
}
@keyframes vibrate-bg {
  0% { box-shadow: 0 0 0 0 #00EAFF44; }
  20% { box-shadow: 0 0 12px 4px #00EAFF88; }
  40% { box-shadow: 0 0 0 0 #00EAFF44; }
  60% { box-shadow: 0 0 12px 4px #00EAFF88; }
  100% { box-shadow: 0 0 0 0 #00EAFF44; }
}
.status-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 16px;
}
.pulse {
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}
.slider-label {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text);
}
input[type="range"] {
  width: 80%;
  margin: 8px 0;
}
.slider-value {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 16px;
}
.bark-alert {
  color: var(--error);
  font-size: 16px;
  font-weight: 600;
  margin-top: 16px;
  min-height: 24px;
  text-align: center;
}
.volume-meter {
  width: 80%;
  height: 16px;
  background: #23243A;
  border-radius: 8px;
  margin: 16px 0 8px 0;
  box-shadow: 0 1px 4px #0002;
  position: relative;
}
.volume-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 8px;
  width: 0%;
  transition: width 0.1s linear;
}
.monitor-instructions {
  color: #aaa;
  font-size: 14px;
  margin-top: 12px;
  text-align: center;
}
#monitorStartBtn.hidden, #monitorStopBtn.hidden {
  display: none;
}
.ios-mic-hint {
  color: #FF4D4F;
  background: #23243A;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 12px 0 0 0;
  font-size: 14px;
  text-align: center;
  max-width: 100%;
}

@media (max-width: 600px) {
  main {
    padding: 16px 4px 0 4px;
  }
  .record-section {
    padding: 24px 4px;
  }
}
