:root {
  --primary: #00ffff;
  --secondary: #6c5ce7;
  --bg-dark: #0f121b;
  --card-bg: #1a1e2b;
  --text-main: #f5f6fa;
  --text-dim: #a4b0be;
  --accent: #ff4757;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  padding: 2rem;
}

.container {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

header {
  margin-bottom: 3rem;
  animation: fadeInDown 0.8s ease-out;
}

header h1 {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: -1px;
}

header h1 span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-dim);
  margin-top: 0.5rem;
}

main {
  background: var(--card-bg);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  animation: scaleUp 0.6s ease-out;
}

.visualizer-container {
  width: 100%;
  height: 250px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

#visualizer {
  width: 100%;
  height: 100%;
}

.status-indicator {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: var(--glass);
  backdrop-filter: blur(8px);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.status-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399; /* Green */
  box-shadow: 0 0 10px #34d399;
}

.status-indicator.capturing .dot {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.status-indicator.recording .dot {
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  animation: pulse 1s infinite;
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.format-settings {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.format-selector {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--glass);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  font-size: 0.9rem;
  color: var(--text-dim);
}

.bitrate-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(108, 92, 231, 0.1);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  border: 1px solid rgba(108, 92, 231, 0.3);
  font-size: 0.85rem;
  animation: fadeInDown 0.3s ease-out;
}

.bitrate-selector select {
  background: var(--bg-dark);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  outline: none;
}

.split-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

.checkbox-container:hover {
  color: var(--text-main);
}

.checkbox-container input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--glass);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  width: 100%;
  max-width: 300px;
  animation: fadeInDown 0.3s ease-out;
}

.slider-container span {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.slider-container span span {
  color: var(--primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.slider-container input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.format-selector label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
  transition: opacity 0.2s;
}

.format-selector label:hover {
  opacity: 0.8;
}

.format-selector input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
}

.btn svg {
  width: 24px;
  height: 24px;
}

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

.btn.primary {
  background: linear-gradient(135deg, var(--secondary), #4834d4);
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.btn.primary:hover {
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.6);
  transform: translateY(-2px);
}

.btn.danger {
  background: linear-gradient(135deg, var(--accent), #eb4d4b);
  box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.btn.danger:hover {
  box-shadow: 0 8px 25px rgba(255, 71, 87, 0.6);
  transform: translateY(-2px);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
}

.action-buttons .btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
}

.save-btn.saved {
  opacity: 0.6;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-dim) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  pointer-events: none;
  cursor: default;
}

.discard-btn:hover {
  background: rgba(255, 71, 87, 0.2) !important;
  color: white !important;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.recording-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.live-filename-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.live-filename-container .filename-input {
  max-width: 350px;
  text-align: center;
  font-weight: normal;
  padding: 0.6rem 1rem;
}

.action-buttons-group {
  display: flex;
  gap: 1rem;
}

.record-icon {
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
}

.record-active .record-icon {
    animation: flash 1s infinite alternate;
}

.hidden {
  display: none !important;
}

.info-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  text-align: left;
  line-height: 1.6;
}

.info-box p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.info-box strong {
  color: var(--text-main);
}

.recordings-list {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.recording-item {
  background: var(--glass);
  padding: 1.5rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border: 1px solid var(--glass-border);
  animation: slideIn 0.4s ease-out backwards;
  transition: transform 0.2s;
}

.recording-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.recording-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.filename-container {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.filename-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  width: 100%;
  max-width: 400px;
  outline: none;
  transition: all 0.2s;
}

.filename-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.extension {
  font-size: 0.95rem;
  color: var(--text-dim);
  font-weight: 400;
  white-space: nowrap;
}

.recording-item .date {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  display: block;
}

.waveform-wrapper {
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.recording-controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.recording-item audio {
  flex: 1;
  height: 36px;
}

footer {
  margin-top: 3rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes flash {
    from { opacity: 1; }
    to { opacity: 0.3; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 600px) {
  body { padding: 1rem; }
  header h1 { font-size: 2rem; }
  main { padding: 1.5rem; }
}

/* Mobile Warning Overlay */
.mobile-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 18, 27, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  transition: opacity 0.3s ease;
}

.warning-content {
  background: var(--card-bg);
  padding: 3rem 2rem;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  max-width: 400px;
  width: 100%;
  animation: scaleUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.warning-content svg {
  width: 64px;
  height: 64px;
  color: var(--accent);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 10px rgba(255, 71, 87, 0.4));
}

.warning-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.warning-content p {
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 0.95rem;
}
