/* ===================================
   INTERACTIVE DASHBOARD STYLES
   ================================ */

/* Expandable Call Rows */
.expandable-call {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
}

.expandable-call .call-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 100%;
  transition: all 0.3s ease;
  padding: 4px;
  border-radius: 8px;
}

.expandable-call.expanded .call-summary {
  flex: 0 0 45%;
  background: rgba(5, 71, 42, 0.05);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  align-self: stretch;
}

.expandable-call:not(.expanded):hover .call-summary {
  background: rgba(5, 71, 42, 0.08);
}

/* Expand Indicator */
.expand-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.expand-indicator svg {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.3s ease;
}

.expandable-call:hover .expand-indicator svg {
  color: rgba(16, 185, 129, 0.8);
}

.expandable-call.expanded .expand-indicator {
  transform: rotate(180deg);
}

/* Expanded Content */
.call-expanded-content {
  flex: 0 0 0%;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              overflow 0s 0.3s;
  padding: 0;
  margin-left: 0;
  will-change: flex, max-width, opacity;
}

.expandable-call.expanded .call-expanded-content {
  flex: 0 0 53%;
  max-width: 53%;
  opacity: 1;
  padding: 10px 0 10px 16px;
  margin-left: 2%;
  overflow: visible;
  transition: flex 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              overflow 0s 0s;
}

/* Call Summary Section */
.call-summary-section {
  margin-bottom: 6px;
  padding: 6px 8px;
  background: rgba(5, 71, 42, 0.05);
  border-radius: 8px;
  border-left: 3px solid rgba(16, 185, 129, 0.5);
  animation: slideInFromLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.summary-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(16, 185, 129, 0.7);
  margin-bottom: 4px;
}

.summary-text {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* Transcript Section */
.transcript-section {
  margin-bottom: 6px;
  padding: 8px;
  background: rgba(10, 10, 10, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.15);
  animation: slideInFromLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s backwards;
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.transcript-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(16, 185, 129, 0.7);
}

.view-full-transcript {
  background: none;
  border: none;
  color: rgba(16, 185, 129, 0.8);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
}

.view-full-transcript:hover {
  background: rgba(16, 185, 129, 0.1);
  color: rgba(16, 185, 129, 1);
  transform: translateX(2px);
}

.transcript-preview {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  min-height: 24px;
  padding: 4px 0;
}

/* Typing Effect */
.typing-text {
  display: inline;
}

.typing-cursor {
  display: inline-block;
  color: rgba(16, 185, 129, 0.8);
  animation: blink 1s steps(1) infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Recording Section */
.recording-section {
  padding: 8px;
  background: linear-gradient(135deg, rgba(5, 71, 42, 0.1) 0%, rgba(10, 10, 10, 0.6) 100%);
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.15);
  animation: slideInFromLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s backwards;
}

.recording-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.recording-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(16, 185, 129, 0.7);
}

.recording-duration {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

/* Audio Player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.play-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #034520 0%, #05472A 100%);
  border: 2px solid rgba(16, 185, 129, 0.3);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.play-button:hover {
  transform: scale(1.1);
  background: linear-gradient(135deg, #05472A 0%, #065f46 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  border-color: rgba(16, 185, 129, 0.6);
}

.play-button:active {
  transform: scale(0.95);
}

.play-button.playing {
  background: linear-gradient(135deg, #065f46 0%, #10b981 100%);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* Waveform Container */
.waveform-container {
  flex: 1;
  height: 32px;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 100%;
  width: 100%;
  position: relative;
  z-index: 2;
}

.waveform-bar {
  flex: 1;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.8) 0%, rgba(16, 185, 129, 0.4) 100%);
  border-radius: 2px;
  min-width: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.waveform-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.6) 0%, rgba(16, 185, 129, 0.8) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

/* Waveform animation on hover */
.audio-player:hover .waveform-bar {
  background: linear-gradient(180deg, rgba(16, 185, 129, 1) 0%, rgba(16, 185, 129, 0.6) 100%);
}

/* Animated waveform when playing */
.audio-player.playing .waveform-bar {
  animation: waveform-pulse 0.8s ease-in-out infinite;
}

.audio-player.playing .waveform-bar:nth-child(1) { animation-delay: 0s; }
.audio-player.playing .waveform-bar:nth-child(2) { animation-delay: 0.05s; }
.audio-player.playing .waveform-bar:nth-child(3) { animation-delay: 0.1s; }
.audio-player.playing .waveform-bar:nth-child(4) { animation-delay: 0.15s; }
.audio-player.playing .waveform-bar:nth-child(5) { animation-delay: 0.2s; }
.audio-player.playing .waveform-bar:nth-child(6) { animation-delay: 0.25s; }
.audio-player.playing .waveform-bar:nth-child(7) { animation-delay: 0.3s; }
.audio-player.playing .waveform-bar:nth-child(8) { animation-delay: 0.35s; }
.audio-player.playing .waveform-bar:nth-child(9) { animation-delay: 0.4s; }
.audio-player.playing .waveform-bar:nth-child(10) { animation-delay: 0.45s; }
.audio-player.playing .waveform-bar:nth-child(11) { animation-delay: 0.5s; }
.audio-player.playing .waveform-bar:nth-child(12) { animation-delay: 0.55s; }
.audio-player.playing .waveform-bar:nth-child(13) { animation-delay: 0.6s; }
.audio-player.playing .waveform-bar:nth-child(14) { animation-delay: 0.65s; }
.audio-player.playing .waveform-bar:nth-child(15) { animation-delay: 0.7s; }
.audio-player.playing .waveform-bar:nth-child(16) { animation-delay: 0.75s; }
.audio-player.playing .waveform-bar:nth-child(17) { animation-delay: 0.8s; }
.audio-player.playing .waveform-bar:nth-child(18) { animation-delay: 0.85s; }
.audio-player.playing .waveform-bar:nth-child(19) { animation-delay: 0.9s; }
.audio-player.playing .waveform-bar:nth-child(20) { animation-delay: 0.95s; }

@keyframes waveform-pulse {
  0%, 100% {
    transform: scaleY(1);
    opacity: 0.8;
  }
  50% {
    transform: scaleY(1.4);
    opacity: 1;
  }
}

/* Waveform Progress */
.waveform-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg,
    rgba(16, 185, 129, 0.2) 0%,
    rgba(236, 72, 153, 0.2) 100%
  );
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 18px;
  z-index: 1;
}

/* Playback Time */
.playback-time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}

/* Slide-in animations */
@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Enhanced hover state for expandable calls */
.expandable-call:not(.expanded):hover {
  background: rgba(5, 71, 42, 0.03);
  transform: translateX(2px);
}

/* Active state */
.expandable-call.expanded {
  background: rgba(5, 71, 42, 0.02);
  padding: 6px;
  border-radius: 12px;
  margin: 2px 0;
}

/* Shimmer effect on first load */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.expandable-call.just-loaded {
  animation: shimmer 2s ease-in-out;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(16, 185, 129, 0.05) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  /* Stack vertically on smaller screens */
  .expandable-call.expanded .call-summary {
    flex: 0 0 100%;
    margin-bottom: 16px;
  }

  .expandable-call.expanded .call-expanded-content {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 16px 12px 12px 12px;
    margin-left: 0;
    border-top: 1px solid rgba(16, 185, 129, 0.1);
  }
}

@media (max-width: 768px) {
  .call-expanded-content {
    padding: 16px 8px;
  }

  .call-summary-section,
  .transcript-section,
  .recording-section {
    padding: 12px;
  }

  .audio-player {
    flex-wrap: wrap;
  }

  .waveform-container {
    width: 100%;
    order: 3;
    margin-top: 8px;
  }

  .playback-time {
    order: 2;
    min-width: auto;
  }

  .transcript-header,
  .recording-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .view-full-transcript {
    align-self: flex-end;
  }

  .expandable-call.expanded {
    padding: 8px;
  }
}

/* Focus states for accessibility */
.expandable-call:focus-within {
  outline: 2px solid rgba(16, 185, 129, 0.5);
  outline-offset: 2px;
}

.play-button:focus {
  outline: 2px solid rgba(16, 185, 129, 0.6);
  outline-offset: 2px;
}

.view-full-transcript:focus {
  outline: 2px solid rgba(16, 185, 129, 0.6);
  outline-offset: 2px;
}

/* Smooth transitions for all interactive elements */
* {
  -webkit-tap-highlight-color: transparent;
}

.expandable-call *,
.audio-player *,
.transcript-section * {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   DASHBOARD HOVER EFFECTS
   "Living Dashboard with Depth"
   =================================== */

/* ============================================
   1. 3D Perspective Transform Setup
   ============================================ */

.dashboard-mockup {
  /* Enable 3D transforms */
  transform-style: preserve-3d;
  perspective: 1000px;

  /* Set up for spotlight effect */
  position: relative;

  /* CSS variables for mouse position tracking */
  --mouse-x: 50%;
  --mouse-y: 50%;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
}

/* Enhanced hover state with 3D tilt */
.dashboard-mockup:hover {
  transform: translate3d(0, -8px, 0)
             rotateX(var(--tilt-x))
             rotateY(var(--tilt-y));
  box-shadow: 0 40px 100px rgba(16, 185, 129, 0.35),
              0 20px 50px rgba(236, 72, 153, 0.25),
              0 0 2px rgba(255, 255, 255, 0.3),
              0 0 80px rgba(16, 185, 129, 0.15);
}

/* ============================================
   2. Cursor Spotlight Effect
   ============================================ */

.dashboard-mockup::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle 400px at var(--mouse-x) var(--mouse-y),
    rgba(16, 185, 129, 0.12) 0%,
    rgba(236, 72, 153, 0.08) 30%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease-out;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}

.dashboard-mockup:hover::before {
  opacity: 1;
}

/* Ensure content stays above spotlight */
.dashboard-header,
.dashboard-content {
  position: relative;
  z-index: 2;
}

/* ============================================
   3. Floating Metric Cards with Enhanced Glow
   ============================================ */

.metric-card {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-mockup:hover .metric-card {
  /* Cards become interactive when dashboard is hovered */
  transform: translateZ(20px);
}

.metric-card:hover {
  transform: translateY(-4px) translateZ(30px) scale(1.02);
  background: rgba(16, 185, 129, 0.03);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2),
              0 4px 12px rgba(236, 72, 153, 0.15),
              0 0 0 1px rgba(16, 185, 129, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.metric-card:hover .metric-value {
  color: #10b981;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
  transform: scale(1.05);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.metric-card:hover .metric-change.positive {
  color: #34d399;
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  }
  50% {
    opacity: 0.85;
    text-shadow: 0 0 16px rgba(52, 211, 153, 0.8);
  }
}

/* Staggered hover response for organic feel */
.metric-card:nth-child(1) { transition-delay: 0ms; }
.metric-card:nth-child(2) { transition-delay: 50ms; }
.metric-card:nth-child(3) { transition-delay: 100ms; }

/* ============================================
   4. Activity Item Interactive Highlights
   ============================================ */

.activity-item {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: 8px;
  padding: 12px;
  margin: -12px;
  border: 1px solid transparent;
}

.activity-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(236, 72, 153, 0.05) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.activity-item:hover {
  background: rgba(16, 185, 129, 0.02);
  border-color: rgba(16, 185, 129, 0.2);
  transform: translateX(4px);
}

.activity-item:hover::before {
  opacity: 1;
}

.activity-item:hover .status-badge {
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.6),
              0 0 24px rgba(16, 185, 129, 0.3);
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.activity-item:hover .activity-icon {
  transform: scale(1.1) rotate(5deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.activity-item:hover .activity-icon svg {
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.5));
}

/* ============================================
   5. Tab Shimmer Animation
   ============================================ */

.tab {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.tab::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transition: left 0.6s ease;
}

.tab:hover::after {
  left: 100%;
}

.tab:hover {
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-1px);
}

.tab:not(.active):hover {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Active tab enhanced glow on hover */
.tab.active:hover {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4),
              inset 0 0 20px rgba(16, 185, 129, 0.1);
}

/* ============================================
   6. Dashboard Header Interactive Glow
   ============================================ */

.dashboard-mockup:hover .dashboard-header {
  background: linear-gradient(
    180deg,
    rgba(16, 185, 129, 0.03) 0%,
    var(--bg-subtle) 100%
  );
  border-bottom-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 1px 0 rgba(16, 185, 129, 0.1),
              0 2px 8px rgba(16, 185, 129, 0.05);
  transition: all 0.4s ease;
}

/* ============================================
   7. Call Duration & Time Enhanced Highlights
   ============================================ */

.activity-item:hover .call-duration,
.activity-item:hover .activity-time {
  color: #10b981;
  font-weight: 600;
  transition: all 0.3s ease;
}

.activity-item:hover .activity-name {
  color: #ffffff;
  transition: color 0.3s ease;
}

/* ============================================
   8. Parallax Content Depth Effect
   ============================================ */

.dashboard-mockup:hover .dashboard-metrics {
  transform: translateZ(10px);
  transition: transform 0.3s ease;
}

.dashboard-mockup:hover .dashboard-activity {
  transform: translateZ(5px);
  transition: transform 0.3s ease;
}

/* ============================================
   9. Enhanced Activity Header on Hover
   ============================================ */

.activity-header {
  transition: all 0.3s ease;
  position: relative;
}

.dashboard-mockup:hover .activity-header {
  color: #10b981;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.activity-header::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: linear-gradient(
    180deg,
    #10b981 0%,
    #ec4899 100%
  );
  border-radius: 2px;
  transition: height 0.3s ease;
}

.dashboard-mockup:hover .activity-header::before {
  height: 100%;
}

/* ============================================
   10. Smooth Performance Optimizations
   ============================================ */

/* Only use will-change when actively needed (on hover) */
.dashboard-mockup:hover {
  will-change: transform;
}

.dashboard-mockup:hover .metric-card,
.dashboard-mockup:hover .activity-item,
.dashboard-mockup:hover .tab {
  will-change: transform;
}

/* CSS Containment for better rendering performance */
.metric-card,
.activity-item {
  contain: layout style paint;
}

/* Optimize repaints with layer promotion */
.dashboard-mockup {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ============================================
   11. Accessibility - Reduce Motion Support
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .dashboard-mockup,
  .metric-card,
  .activity-item,
  .tab {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  .dashboard-mockup:hover {
    transform: translate3d(0, -4px, 0) !important;
  }
}

/* ============================================
   12. Mobile Optimization - Simplified Effects
   ============================================ */

@media (max-width: 768px) {
  /* Disable 3D transforms on mobile for performance */
  .dashboard-mockup {
    perspective: none;
  }

  .dashboard-mockup:hover {
    transform: translate3d(0, -4px, 0) !important;
  }

  /* Simplify card effects on mobile */
  .metric-card:hover {
    transform: translateY(-2px) scale(1.01);
  }

  /* Disable spotlight on mobile */
  .dashboard-mockup::before {
    display: none;
  }
}
