:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --secondary-color: #1f2937;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1.25rem;
}

.container {
  width: 100%;
  max-width: 600px;
  display: grid;
  gap: 1.5rem;
}

.tool-card {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
}

.tool-card h2 {
  color: var(--secondary-color);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

.status-indicator.recording {
  background: #ef4444;
  animation: pulse-red 1s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes pulse-red {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.status-text {
  flex: 1;
  color: var(--text-secondary);
  font-weight: 500;
}

.timer {
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-weight: bold;
  color: var(--secondary-color);
  font-size: 1.2rem;
}

.control-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.btn {
  flex: 1;
  min-width: 120px;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #111827;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-danger:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-info {
  background: var(--info);
  color: white;
}

.btn-info:hover {
  background: #0891b2;
  transform: translateY(-1px);
}

.visualizer-container {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #1f2937;
  border-radius: 6px;
  overflow: hidden;
}

.visualizer {
  width: 100%;
  height: 100px;
  display: block;
}

.info-group {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-item label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-item input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-item input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.volume-meter {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.volume-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
  transition: width 0.1s ease;
}

.progress-container {
  margin: 1.5rem 0;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--primary-color);
  transition: width 0.1s linear;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.no-data,
.empty-message {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-secondary);
  border: 2px dashed var(--border-color);
  border-radius: 8px;
}

.saved-list {
  display: grid;
  gap: 1rem;
}

.saved-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.saved-item-info {
  flex: 1;
  min-width: 0;
}

.saved-item-name {
  font-weight: 600;
  color: var(--secondary-color);
  word-break: break-all;
}

.saved-item-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.saved-item-buttons {
  display: flex;
  gap: 0.5rem;
}

.saved-item-buttons button {
  padding: 0.5rem 0.75rem;
  border: none;
  background: var(--primary-color);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.saved-item-buttons button:hover {
  background: var(--primary-dark);
}

.playback-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.playback-controls .btn {
  flex: 1;
}

@media (max-width: 768px) {
  .tool-card {
    padding: 1.5rem;
  }

  .control-group {
    gap: 0.5rem;
  }

  .btn {
    min-width: 100px;
    padding: 0.7rem 0.75rem;
    font-size: 0.85rem;
  }
}
