@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-gradient: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
}

.rec-transcription {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  margin: 0;
  min-height: 100vh;
  padding: 40px 20px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  /* Premium Gold Gradient */
  background: linear-gradient(to right, #fcd34d, #f59e0b, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  letter-spacing: -1px;
  text-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}

/* Icon Styles */
.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
}

.icon-mic {
  animation: none;
}

.recording .icon-mic {
  animation: mic-pulse 1.5s infinite;
}

.icon-spin {
  animation: spin 1s linear infinite;
}

@keyframes mic-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 10px;
}

/* Main Recorder Card */
.recorder-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: var(--glass-border);
  border-radius: 24px;
  padding: 50px 30px;
  /* Increased vertical padding */
  min-height: 400px;
  /* Added min-height */
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px;
  text-align: center;
}

.controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.input-group {
  width: 100%;
  max-width: 400px;
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: var(--primary);
}

.btn-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  /* Pill shape */
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

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

.btn-danger {
  background: #ef4444;
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

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

.btn-success {
  background: #10b981;
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

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

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  margin-bottom: 20px;
}

.status-badge.recording {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.live-player {
  width: 100%;
  max-width: 500px;
  margin-top: 20px;
  border-radius: 8px;
}

/* History Section */
.history-section {
  margin-top: 60px;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.recordings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.recording-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.2s;
}

.recording-item:hover {
  transform: translateY(-4px);
  background: rgba(30, 41, 59, 0.8);
}

.rec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.rec-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-main);
}

.rec-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rec-transcription {
  font-size: 0.9rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.2);
  padding: 1px;
  padding-bottom: 10px !important;
  padding-left: 5px !important;
  border-radius: 8px;
  margin: 10px 0;
  max-height: 84px;
  /* Reduced specific height as requested */
  overflow-y: auto;
  white-space: pre-wrap;
}

.rec-audio,
.live-player {
  width: 100%;
  height: 40px;
  margin-top: 15px;
  border-radius: 20px;
  /* CSS Filter to invert/adjust colors for dark theme loosely */
  filter: invert(100%) hue-rotate(180deg) contrast(0.8);
  opacity: 0.9;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }

  .controls-wrapper {
    gap: 15px;
  }

  .btn-group {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 10px;
  }

  button {
    width: 100%;
    justify-content: center;
    padding: 14px;
    /* Touchable area */
  }

  .input-group {
    max-width: 100%;
  }

  .recorder-card {
    padding: 20px;
  }
}