/*
* demo.css
* File include item demo only specific css only
******************************************************************************/

.menu .app-brand.demo {
  height: 50px;
}

.app-brand-logo.demo svg {
  width: 22px;
  height: 38px;
}

.app-brand-text.demo {
  font-size: 1.75rem;
  letter-spacing: -0.5px;
  text-transform: lowercase;
}

/* ! For .layout-navbar-fixed added fix padding top to .layout-page */
/* Detached navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 50px !important;
}
/* Default navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 50px !important;
}
.docs-page .layout-navbar-fixed.layout-wrapper:not(.layout-without-menu) .layout-page,
.docs-page .layout-menu-fixed.layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 50px !important;
}

/* Navbar page z-index issue solution */
.content-wrapper .navbar {
  z-index: auto;
}

/*
* Content
******************************************************************************/

.demo-blocks > * {
  display: block !important;
}

.demo-inline-spacing > * {
  margin: 1rem 0.375rem 0 0 !important;
}

/* ? .demo-vertical-spacing class is used to have vertical margins between elements. To remove margin-top from the first-child, use .demo-only-element class with .demo-vertical-spacing class. For example, we have used this class in forms-input-groups.html file. */
.demo-vertical-spacing > * {
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-lg > * {
  margin-top: 1.875rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-lg.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.demo-vertical-spacing-xl > * {
  margin-top: 5rem !important;
  margin-bottom: 0 !important;
}
.demo-vertical-spacing-xl.demo-only-element > :first-child {
  margin-top: 0 !important;
}

.rtl-only {
  display: none !important;
  text-align: left !important;
  direction: ltr !important;
}

[dir='rtl'] .rtl-only {
  display: block !important;
}

/* Dropdown buttons going out of small screens */
@media (max-width: 576px) {
  #dropdown-variation-demo .btn-group .text-truncate {
    width: 231px;
    position: relative;
  }
  #dropdown-variation-demo .btn-group .text-truncate::after {
    position: absolute;
    top: 45%;
    right: 0.65rem;
  }
}

/*
* Layout demo
******************************************************************************/

.layout-demo-wrapper {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-top: 1rem;
}
.layout-demo-placeholder img {
  width: 900px;
}
.layout-demo-info {
  text-align: center;
  margin-top: 1rem;
}

/* ==========================================================================
   CONVERSATION EVENTS STYLING
   Click-to-expand event panels that inject inline in the transcript
   ========================================================================== */

/* Container for messages with events
   ========================================================================== */
.message-with-events {
  position: relative;
  transition: background-color 0.3s ease;
}

/* Events Indicator Badge (Click to expand)
   ========================================================================== */
.events-indicator {
  /* Reset button styles */
  border: none;
  background: none;
  padding: 0;
  
  /* Positioning */
  position: absolute;
  right: 10px;
  bottom: -15px;
  
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 24px;
  height: 24px;
  
  /* Appearance */
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  
  /* Animation */
  opacity: 0.7;
  transition: all 0.3s ease;
  cursor: pointer;
}

.events-indicator:hover {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.5);
}

.events-indicator i {
  font-size: 12px;
  color: white;
  animation: pulse-indicator 2s ease-in-out infinite;
}

@keyframes pulse-indicator {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.events-count {
  /* Typography */
  font-size: 10px;
  font-weight: 700;
  color: white;
  
  /* Positioning */
  position: absolute;
  top: -2px;
  right: -2px;
  
  /* Layout */
  min-width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  
  /* Appearance */
  background: #ef4444;
  border-radius: 7px;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Events Panel (Expandable inline panel)
   ========================================================================== */
.events-panel {
  /* Layout */
  margin: 12px auto 16px auto;
  padding: 0;
  width: 80%;
  
  /* Appearance */
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  font-family: 'Courier New', Consolas, Monaco, monospace;
}

/* Panel Header */
.events-panel-header {
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  
  /* Appearance */
  background: #e9ecef;
  border-bottom: 1px solid #dee2e6;
}

.events-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #495057;
  font-weight: 500;
  font-size: 12px;
}

.events-panel-title i {
  font-size: 16px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.events-panel-count {
  /* Layout */
  padding: 2px 8px;
  
  /* Appearance */
  background: #dee2e6;
  border-radius: 4px;
  
  /* Typography */
  font-size: 11px;
  font-weight: 500;
  color: #6c757d;
}

.events-panel-close {
  /* Reset button styles */
  border: none;
  padding: 0;
  
  /* Layout */
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Appearance */
  background: transparent;
  border-radius: 3px;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s ease;
}

.events-panel-close:hover {
  background: #dee2e6;
  color: #495057;
}

.events-panel-close i {
  font-size: 16px;
}

/* Panel Content */
.events-panel-content {
  padding: 8px;
  background: #ffffff;
}

/* Events Timeline
   ========================================================================== */
.events-timeline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

/* Individual Event Items in Timeline
   ========================================================================== */
.events-timeline .event-item {
  /* Layout */
  padding: 6px 8px;
  position: relative;
  
  /* Appearance */
  background: #f8f9fa;
  border-radius: 3px;
  
  /* Interaction */
  transition: background 0.1s ease;
}

.events-timeline .event-item:hover {
  background: #e9ecef;
}

.event-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
}

.event-header i {
  font-size: 14px;
  min-width: 14px;
  /* Color set inline via style attribute */
}

.event-label {
  font-weight: 400;
  color: #495057;
}

.event-value {
  /* Layout */
  padding: 2px 6px;
  
  /* Appearance */
  background: #e9ecef;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  
  /* Typography */
  font-size: 10px;
  font-weight: 400;
  font-family: 'Courier New', monospace;
  color: #6c757d;
}

.event-details {
  /* Layout */
  margin-top: 4px;
  padding: 4px 8px;
  
  /* Appearance */
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 3px;
}

.event-details-content {
  /* Typography */
  font-size: 10px;
  font-family: 'Courier New', monospace;
  color: #6c757d;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
  text-align: center;
}

/* Call Ended Indicator
   ========================================================================== */
.call-ended-indicator {
  /* Layout */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  
  /* Appearance */
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
  border-radius: 6px;
  
  /* Typography */
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
}

.call-ended-indicator i {
  font-size: 14px;
}

/* Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
  .events-indicator {
    left: -30px;
    width: 24px;
    height: 24px;
  }
  
  .events-panel {
    margin: 10px 0 12px 0;
  }
  
  .events-panel-header {
    padding: 12px 14px;
  }
  
  .events-panel-title {
    font-size: 13px;
    gap: 8px;
  }
  
  .events-panel-content {
    padding: 12px;
  }
  
  .events-timeline .event-item {
    padding: 10px 10px 10px 40px;
  }
  
  .events-timeline::before {
    left: 20px;
  }
  
  .events-timeline .event-item::before {
    left: 14px;
    top: 14px;
    width: 10px;
    height: 10px;
  }
  
  .event-header {
    font-size: 12px;
  }
  
  .call-ended-indicator {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* Voice Configuration Section Styles */
.cost-breakdown-container {
  position: relative;
  transition: all 0.3s ease;
}

.cost-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.cost-segment:last-child {
  border-right: none;
}

.cost-segment:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cost-tooltip {
  animation: tooltipFadeIn 0.2s ease-in-out;
  min-width: 140px;
  text-align: center;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Voice Configuration Card */
.voice-config-card {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.voice-config-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px);
}

/* Enhanced button styles for TTS/STT */
.btn-outline-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(95, 95, 197, 0.2);
}

.btn-outline-primary:active {
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .cost-breakdown-container {
    height: 40px;
  }
  
  .cost-tooltip {
    font-size: 0.7rem;
    padding: 6px 10px;
  }
}