/* style.css */

/* Basic loader */
.loader {
  border: 3px solid #E5E7EB;
  border-top: 3px solid #4F46E5;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes spin {
  0% { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}

/* Welcome Header */
.welcome-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* Title styling with gradient */
.greeting, #clientTitle {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.greeting {
  font-size: 2.00rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #6B7280; /* fallback */
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  background: none;
}

#clientTitle {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* Progress text styling */
#progressContainer {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: #6B7280;
}

/* "Questions due" / "Questions done" bigger */
#qsDue, #qsCompleted {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: #4B5563;
}

/* numeric count in bold black */
#qsDue span, #qsCompleted span {
  color: #000000;
  font-weight: 700;
}

/* Category Heading - no container */
.category-heading {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #1e293b;
  letter-spacing: -0.025em;
}

/* question-card */
.question-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #f1f5f9;
  position: relative;
  overflow: hidden;
}
.question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #8B5CF6;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.question-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.15);
}
.question-card:hover::before {
  opacity: 1;
}

/* question-card text */
.question-card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #1F2937;
  letter-spacing: -0.01em;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.question-card p {
  font-size: 1rem;
  color: #4B5563;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.btn::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: linear-gradient(rgba(255,255,255,0.1), rgba(255,255,255,0));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.btn:hover::after {
  opacity: 1;
}

.btn-record {
  background-color: #F97316; 
  color: white;
}
.btn-record:hover {
  background-color: #EA580C;
}

.btn-uploadvoice,
.btn-uploadvideo,
.btn-uploadimage,
.btn-uploaddoc,
.btn-notes {
  background-color: #374151;
  color: white;
}
.btn-uploadvoice:hover,
.btn-uploadvideo:hover,
.btn-uploadimage:hover,
.btn-uploaddoc:hover,
.btn-notes:hover {
  background-color: #1F2937;
  transform: translateY(-2px);
}

.btn-tips {
  background-color: #4B5563;
  color: white;
}
.btn-tips:hover {
  background-color: #374151;
  transform: translateY(-2px);
}

.btn-success {
  background-color: #10B981;
  color: #fff;
}
.btn-danger {
  background-color: #EF4444;
  color: #fff;
}
.btn-warning {
  background-color: #F59E0B;
  color: #fff;
}

/* Create a question => .btn-create */
.btn-create {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  color: #fff;
  font-size: 1rem;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  min-width: 180px;
  max-width: 100%;
}
.btn-create:hover {
  background: linear-gradient(135deg, #4338CA 0%, #6D28D9 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

/* fade-out for delete */
.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}
@keyframes fadeOut {
  from { opacity:1; transform:translateY(0); }
  to { opacity:0; transform:translateY(-20px); }
}

/* processingModal backdrop */
#processingModal {
  backdrop-filter: blur(5px);
}

.control-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* TIPS button => not used here. hidden if you want. */
#tipsToggleBtn {
  position: fixed;
  bottom: 16px; 
  left: 16px;
  background-color: #374151; 
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  z-index: 9999;
  font-size: 0.875rem;
  transition: transform 0.2s ease;
}
#tipsToggleBtn:hover {
  background-color: #1F2937;
  transform: translateY(-2px);
}

#tipsPanel {
  display: none;
  position: fixed;
  bottom: 70px;
  left: 16px;
  width: 300px;
  background-color: white;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 9999;
}

/* responsive: smaller screens */
@media (max-width: 640px) {
  .control-group {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Modern Form Styling */
input, textarea {
  transition: all 0.3s ease;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
}
input:focus, textarea:focus {
  background: #ffffff;
  border-color: #8B5CF6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

/* Glass Morphism for modals */
.modal-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Loading skeleton */
.loading-skeleton {
  background: linear-gradient(
    90deg,
    #f1f5f9 0%,
    #e2e8f0 50%,
    #f1f5f9 100%
  );
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}
@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* small micro interactions */
.btn-success:active {
  transform: scale(0.95);
}

/* dark mode */
@media (prefers-color-scheme: dark) {
  .greeting, #clientTitle, #progressContainer, #qsDue, #qsCompleted {
    background: linear-gradient(135deg, #818CF8 0%, #A78BFA 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* Recording Controls / Audio Visualization */
.recording-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.btn-record-main {
  min-width: 120px;
  padding: 0.75rem 1.25rem;
}
.btn-record-cancel {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  background-color: #EF4444;
  opacity: 0.85;
  min-width: auto;
}

/* hover on action buttons */
.btn-record:hover,
.btn-uploadvoice:hover,
.btn-uploadvideo:hover,
.btn-uploadimage:hover,
.btn-uploaddoc:hover,
.btn-notes:hover,
.btn-tips:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Waveform */
.recording-viz {
  background: #FFFFFF;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 10px;
}
.recording-viz::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  pointer-events: none;
}
.recording-viz span {
  width: 3px;
  height: 20px;
  background: #4F46E5;
  border-radius: 3px;
  animation: waveform 0.5s ease-in-out infinite;
}
.recording-viz span:nth-child(2n) {
  animation-delay: 0.2s;
  height: 35px;
}
.recording-viz span:nth-child(3n) {
  animation-delay: 0.3s;
  height: 45px;
}
.recording-viz span:nth-child(4n) {
  animation-delay: 0.4s;
  height: 25px;
}
@keyframes waveform {
  0%, 100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1);
  }
}
.timer {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  font-family: monospace;
  font-size: 14px;
  color: #4F46E5;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #E5E7EB;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.visualizer {
  width: 100%;
  height: 100%;
  display: block;
}
/* Pause/Resume & Submit/Cancel for audio */
#pauseResumeBtn {
  background-color: #F59E0B;
  color: white;
  padding: 0.625rem 1.25rem;
  font-weight: 700;
}
#pauseResumeBtn:hover {
  background-color: #D97706;
  transform: translateY(-1px);
}
#submitBtn {
  background-color: #10B981;
  color: white;
  padding: 0.625rem 1.25rem;
  font-weight: 700;
}
#submitBtn:hover {
  background-color: #059669;
  transform: translateY(-1px);
}
#cancelRecordingBtn {
  background-color: #EF4444;
  color: white;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
}
#cancelRecordingBtn:hover {
  background-color: #DC2626;
}

/* Apple-style Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', system-ui, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* small delete button styling */
.btn-delete {
  font-size: 0.6rem;
  padding: 0.15rem 0.3rem;
  background-color: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  margin-top: 1rem;
}
.btn-delete:hover {
  background-color: #FEE2E2;
  color: #B91C1C;
  border-color: #EF4444;
}
