/* ========================================================
   REUSABLE UI COMPONENTS (WCAG AAA HIGH CONTRAST)
   ======================================================== */

/* Card Styles */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-glass);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.6rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Soundbox Hardware Simulator Widget */
.soundbox-widget {
  background: linear-gradient(145deg, #0a192f 0%, #001233 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1.5px solid rgba(0, 186, 242, 0.4);
  box-shadow: var(--shadow-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.soundbox-hardware {
  width: 140px;
  height: 140px;
  margin: 1.2rem auto;
  background: #002970;
  border-radius: 26px;
  border: 4px solid var(--paytm-cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0, 186, 242, 0.45);
  position: relative;
  transition: transform 0.3s ease;
}

.soundbox-hardware.speaking {
  animation: pulse-glow 1.2s infinite alternate;
  transform: scale(1.05);
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 18px rgba(0, 186, 242, 0.5); }
  100% { box-shadow: 0 0 40px rgba(16, 185, 129, 0.9); }
}

.sound-waves {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  margin: 0.8rem 0;
}

.wave-bar {
  width: 4px;
  height: 8px;
  background: var(--paytm-cyan);
  border-radius: 4px;
  transition: height 0.15s ease;
}

.soundbox-hardware.speaking .wave-bar {
  animation: wave-animation 0.6s infinite alternate ease-in-out;
}

.soundbox-hardware.speaking .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.soundbox-hardware.speaking .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.soundbox-hardware.speaking .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.soundbox-hardware.speaking .wave-bar:nth-child(5) { animation-delay: 0.15s; }

@keyframes wave-animation {
  0% { height: 6px; }
  100% { height: 26px; }
}

/* Mic Button */
.mic-btn {
  background: linear-gradient(135deg, var(--paytm-blue) 0%, var(--paytm-primary) 100%);
  color: white;
  border: 2px solid rgba(0, 186, 242, 0.4);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  font-size: 1.6rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 41, 112, 0.4);
  transition: all 0.2s ease;
}

.mic-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 25px rgba(0, 186, 242, 0.6);
}

.mic-btn.listening {
  background: #dc2626;
  border-color: #f87171;
  animation: pulse-mic 1s infinite alternate;
}

@keyframes pulse-mic {
  0% { box-shadow: 0 0 10px rgba(220, 38, 38, 0.5); }
  100% { box-shadow: 0 0 30px rgba(220, 38, 38, 0.95); }
}

/* ReAct Thought Stream Terminal */
.thought-stream {
  background: #040914;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  color: #7dd3fc;
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid rgba(0, 186, 242, 0.35);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.thought-entry {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* Data Tables */
.vyapar-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.vyapar-table th {
  padding: 0.95rem 1.2rem;
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1.5px solid var(--border-glass);
}

.vyapar-table td {
  padding: 1.05rem 1.2rem;
  border-bottom: 1.5px solid var(--border-subtle);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* High Contrast Quick Badges */
.badge {
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.badge-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-paytm { background: #e0f2fe; color: #004b99; border: 1px solid #bae6fd; }

[data-theme="dark"] .badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; border-color: rgba(16, 185, 129, 0.4); }
[data-theme="dark"] .badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border-color: rgba(245, 158, 11, 0.4); }
[data-theme="dark"] .badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
[data-theme="dark"] .badge-paytm { background: rgba(0, 186, 242, 0.2); color: #38bdf8; border-color: rgba(0, 186, 242, 0.4); }

/* Quick Action Buttons */
.btn-sm {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary { 
  background: linear-gradient(135deg, #002970 0%, #0056b3 100%); 
  color: white; 
  box-shadow: 0 2px 8px rgba(0, 41, 112, 0.25);
}
.btn-primary:hover { 
  background: linear-gradient(135deg, #001f54 0%, #004494 100%); 
  transform: translateY(-1px);
}

.btn-cyan { 
  background: linear-gradient(135deg, #00baf2 0%, #0098d4 100%); 
  color: #001233; 
  font-weight: 800;
}
.btn-cyan:hover { 
  background: #00a5e3; 
  transform: translateY(-1px);
}

.btn-outline { 
  background: transparent; 
  border: 1.5px solid var(--border-glass); 
  color: var(--text-primary); 
  font-weight: 700;
}
.btn-outline:hover { 
  background: var(--bg-card-hover); 
  border-color: var(--border-focus);
}
