/* CSS Variables */
:root {
  --nav-height: 200px;
  --keyboard-height: 270px;
  --safe-area-bottom: env(safe-area-inset-bottom); 
}

/* New layout for items */

.item-wrapper {
  width: 100%;
  max-width: 1024px;
  display: flex;
  flex-direction: column;
  /* height: calc(100svh - var(--nav-height) - var(safe-area-inset-bottom) - var(safe-area-inset-top)); */
  margin: 0 auto;
}

.item-container {
  height:calc(100svh - env(safe-area-inset-bottom) - env(safe-area-inset-top));
  display:flex;
  flex-direction: column;
  width: 100%;
  a {
    text-decoration: none;
  }
  /* .mobile-only {
    display: inline;
    @media (min-width: 768px) {
      display: none;
    }
  } */
}

.item-header {
  margin-top: calc(var(--safe-area-inset-top) + 30px);
  height: 60px;
  display: flex;
  align-items: left;
  /* justify-content: center; */
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 4px var(--navbar-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  .item-header-left {
    margin-left: 16px;
    @media (max-width: 768px) {
      .items-image {
        height: 30px;
        margin: 5px 0 0 0px;
        padding: 0;
      }
    }
  }

  #chat-title {
    display: inline;
  }

  .item-header-title {
    margin: 8px 10px 0 0;
    width: 100%;
    vertical-align: middle;
    font-family: "Madimi One", sans-serif;
    font-size: 1rem;
    color: var(--color-primary);
    height: 52px;
    overflow: hidden;
    @media (min-width: 768px) {
      margin-top: 12px;
      font-size: 1.5rem;
    }
  }
  .item-header-right {
    margin: 8px 20px 0 0;
    max-height: 52px;
    max-width: 90px;
    text-align: right;
    width: 100%;
    font-size: 1rem;
    color: var(--color-text-light);
  }
}

.item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #f4f4f4;
  padding: 20px;
  position: relative;
}

#gc-messages {
  display:block;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 20px;
  scroll-behavior: smooth;
  padding-bottom: 50svh;
}

.item-footer {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: white;
  border-top: 1px solid #ddd;
  flex-shrink: 0;
  /* position: relative; */
  z-index: 1;
  margin-bottom: calc(var(--safe-area-bottom) > 10px ? calc(var(--safe-area-bottom) + 125px) : calc(var(--safe-area-bottom) + 50px));
  .chat-form-global {
    width: 100%;
    display: flex;
    align-items: center;
  }
}

#chatInput {
  font-size: 16px;
  /* Prevents iOS zoom */
  flex-grow: 1;
  min-height: 40px;
  max-height: 150px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  resize: none;
  overflow-y: hidden;
  /* Hides scrollbar for smooth expansion */
  margin-right: 10px;
}

.chat-submit {
  align-self: flex-start;
  height: 40px;
}

.speaker-transcription-container {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  height: 100px;
  max-height: 100px;
  overflow-y: auto;
  scroll-behavior: smooth;
  position: relative;
  margin-top: 10px;
  background: white;
}

.transcription-entry {
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  margin-bottom: 4px;
  cursor: pointer;
}

.transcription-entry:hover {
  background-color: rgba(88, 41, 180, 0.05);
}

.transcription-entry.active-entry {
  background-color: rgba(88, 41, 180, 0.1);
  border-left: 3px solid #5829b4;
  padding-left: 12px;
}

.transcription-entry .time {
  color: #666;
  margin-right: 8px;
}

.transcription-entry .duration {
  color: #888;
  font-size: 0.9em;
  margin-right: 8px;
}

.transcription-entry .text {
  color: #333;
}

.speaker-select-container {
  margin: 20px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 15px;
  &.confirmed {
    background-color: #90ee90;
  }
  &.unconfirmed {
    background-color: #ffb6c1;
  }
}

#transcript-overlay {
  position: fixed;
  top: 6cap;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 1024px;
  height: calc(100svh - 200px);
  display: none;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 20px;
  z-index: 1001;
  .current-timestamp {
    background-color: #ccc;
    color: white;
  }
  .timestamp-link {
    cursor: pointer;
    color: #5829b4;
    transition: all 0.2s ease;
    position: relative;
    border-radius: 4px;
  }
}

#transcript-overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
}

#overlay-title{
  height:20px;
}

#overlay-player {
  width: 100%;
  height: 48px;
  margin: 10px 0;
  border-radius: 8px;
  background-color: rgba(88, 41, 180, 0.05);
  border: none;
}

/* Chrome/Safari/Edge specific styling */
#overlay-player::-webkit-media-controls {
  background-color: transparent;
}

#overlay-player::-webkit-media-controls-enclosure {
  background-color: transparent;
  border-radius: 8px;
}

#overlay-player::-webkit-media-controls-panel {
  background-color: transparent;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

#overlay-player::-webkit-media-controls-play-button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #5829b4;
  color: white;
  opacity: 1;
}

#overlay-player::-webkit-media-controls-timeline-container {
  padding: 0;
}

#overlay-player::-webkit-media-controls-timeline {
  height: 4px;
  padding: 0;
  margin: 0 10px;
  border-radius: 2px;
  background-color: rgba(88, 41, 180, 0.1);
}

#overlay-player::-webkit-media-controls-current-time-display,
#overlay-player::-webkit-media-controls-time-remaining-display {
  color: #495057;
  font-size: 13px;
  font-weight: 500;
  min-width: 45px;
  margin: 0 4px;
  padding: 0;
}

#overlay-player::-webkit-media-controls-volume-slider {
  width: 80px;
  background-color: rgba(88, 41, 180, 0.1);
  border-radius: 2px;
  height: 4px;
}

#overlay-player::-webkit-media-controls-volume-slider-container {
  width: 80px;
  padding: 0 10px;
}

#overlay-player::-webkit-media-controls-mute-button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: transparent;
  opacity: 0.7;
  padding: 0;
}

#overlay-player::-webkit-media-controls-toggle-closed-captions-button {
  display: none;
}

/* Firefox specific styling */
#overlay-player::-moz-range-track {
  height: 4px;
  background-color: rgba(88, 41, 180, 0.1);
  border-radius: 2px;
}

#overlay-player::-moz-range-thumb {
  height: 12px;
  width: 12px;
  background-color: #5829b4;
  border: none;
  border-radius: 50%;
}

#overlay-player::-moz-range-progress {
  height: 4px;
  background-color: #5829b4;
  border-radius: 2px;
}

/* Additional styling for better visibility */
#overlay-player::-webkit-media-controls-play-button:hover,
#overlay-player::-webkit-media-controls-mute-button:hover {
  opacity: 1;
  transform: scale(1.05);
}

#overlay-player::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: #5829b4;
  cursor: pointer;
  margin-top: -4px;
}

#overlay-player::-webkit-slider-runnable-track {
  height: 4px;
  background-color: rgba(88, 41, 180, 0.1);
  border-radius: 2px;
}

/* Ensure the player container has proper spacing */
#overlay-player-container {
  width: 100%;
  padding: 10px 0;
  background-color: rgba(88, 41, 180, 0.03);
  border-radius: 8px;
  margin: 10px 0;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}

.play-pause-btn {
  background: #5829b4;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.play-pause-btn:hover {
  background: #4a1fa0;
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(88, 41, 180, 0.2);
}

.time-control {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.time {
  color: #495057;
  font-size: 13px;
  font-weight: 500;
  min-width: 45px;
}

.seek-slider {
  flex-grow: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(88, 41, 180, 0.1);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.seek-slider:hover {
  height: 6px;
}

.seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5829b4;
  cursor: pointer;
  border: none;
  margin-top: -4px;
  box-shadow: 0 1px 3px rgba(88, 41, 180, 0.3);
  transition: all 0.2s ease;
}

.seek-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #4a1fa0;
  box-shadow: 0 2px 4px rgba(88, 41, 180, 0.4);
}

.seek-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #5829b4;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(88, 41, 180, 0.3);
  transition: all 0.2s ease;
}

.seek-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #4a1fa0;
  box-shadow: 0 2px 4px rgba(88, 41, 180, 0.4);
}

.seek-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(88, 41, 180, 0.1);
  border-radius: 2px;
  border: none;
  transition: all 0.2s ease;
}

.seek-slider::-moz-range-track {
  height: 4px;
  background: rgba(88, 41, 180, 0.1);
  border-radius: 2px;
  border: none;
  transition: all 0.2s ease;
}

#transcript-overlay-content {
  height: calc(100% - 80px);
  overflow-y: auto;
}

/* End new layout for items */

/* Memori Detail Page */
.memori-detail {
  background: linear-gradient(to bottom, #f8f9fa, #ffffff);
  min-height: calc(svh - var(--nav-height) - env(safe-area-inset-bottom));
  height: calc(100d vh - var(--nav-height) - env(safe-area-inset-bottom));
  max-height: calc(svh - var(--nav-height) - env(safe-area-inset-bottom));
  overflow: hidden;
}

.memori-detail h1 {
  font-family: "Madimi One", sans-serif;
  color: #5829b4;
  font-size: 1.5rem;
  margin-bottom: 0;
}

.memori-detail .text-muted {
  color: #6c757d !important;
}

/* Audio Player */
.audio-player {
  background: #ffffff;
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.5rem;
}

.audio-player:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.audio-player .card-body {
  padding: 0.5rem;
}

.audio-player .player-controls {
  position: relative;
}

.audio-player .player-controls #play-pause {
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  background-color: #5829b4;
  border-color: #5829b4;
}

.audio-player .player-controls #play-pause:hover {
  transform: scale(1.05);
  background-color: #4a1fa0;
}

.audio-player .player-controls #play-pause.playing {
  background-color: #dc3545;
  border-color: #dc3545;
}

.audio-player .player-controls #play-pause.playing:hover {
  background-color: #c82333;
}

.audio-player .player-controls #play-pause i {
  font-size: 1.2rem;
}

.audio-player .player-controls .time-display {
  min-width: 65px;
  font-size: 1rem;
  color: #495057;
}

.audio-player .player-controls .audio-progress {
  height: 8px;
  background-color: #e9ecef;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
}

.audio-player .player-controls .audio-progress .audio-progress-fill {
  background-color: #5829b4;
  transition: width 0.1s linear;
}

.audio-player .player-controls .audio-progress:hover .audio-progress-fill {
  background-color: #4a1fa0;
}

/* Content Area */
.content-area {
  background: #ffffff;
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  height: calc(svh - 220px);
  min-height: 300px;
}

.content-area .card-header {
  background: none;
  border-bottom: 1px solid #e9ecef;
  padding: 0.25rem;
  border-radius: 0.75rem 0.75rem 0 0;
  flex-shrink: 0;
}

.content-area .tab-navigation {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem;
  margin: 0;
}

.content-area .tab-item {
  flex: 0 0 auto;
}

.content-area .tab-button {
  text-decoration: none;
  color: #6c757d;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border-radius: 2rem;
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  margin: 0;
}

.content-area .tab-button a {
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.content-area .tab-button:hover,
.content-area .tab-button:hover a {
  color: #495057;
  background-color: #f8f9fa;
}

.content-area .tab-button.active,
.content-area .tab-button.active a {
  background-color: #5829b4;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(88, 41, 180, 0.2);
}

.content-area .tab-button i {
  font-size: 1rem;
  opacity: 0.7;
}

.content-area .tab-button.active i {
  opacity: 1;
}

.content-area .tab-panel {
  display: none;
  height: 100%;
  overflow-y: auto;
}

.content-area .tab-panel.active {
  display: block !important;
}

.content-area .card-body {
  padding: 1rem;
  flex-grow: 1;
  overflow: hidden;
  position: relative;
}

.content-area .section-title {
  color: #5829b4;
  margin-bottom: 1rem;
}

.content-area .section-content {
  line-height: 1.4;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.content-area .empty-state {
  color: #6c757d;
  font-style: italic;
}

.content-area .timestamp-link {
  cursor: pointer;
  color: #5829b4;
  transition: all 0.2s ease;
  position: relative;
}

.content-area .timestamp-link:hover {
  color: #4a1fa0;
  text-decoration: underline;
  background-color: rgba(88, 41, 180, 0.05);
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}

.content-area .timestamp-link:active {
  background-color: rgba(88, 41, 180, 0.15);
}

.content-area .timestamp-link.current-timestamp {
  background-color: rgba(88, 41, 180, 0.1);
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
  font-weight: 500;
}

.content-area .card-body .share-options .input-group {
  max-width: 500px;
}

.content-area .card-body .share-options .short-code .badge {
  font-size: 1rem;
  padding: 0.5rem 1rem;
  background-color: #5829b4;
}

#speakers-list .speaker-item {
  font-weight: bold;
  margin: 20px 0;
  .speaker-input-container input {
    border: 0;
  }
}

#speakers-list .speaker-transcription {
  max-height: 300px;
  overflow-y: auto;
  padding: 5px;
  font-weight: normal;
}

/* Mobile Optimizations */
@media (max-width: 767px) {
  .memori-detail {
    padding: 0.5rem;
  }

  .memori-detail h1 {
    font-size: 1.25rem;
  }

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

  .audio-player .player-controls #play-pause {
    width: 40px;
    height: 40px;
  }

  .audio-player .player-controls .time-display {
    order: 3;
    margin-top: 0.5rem;
  }

  .audio-player .player-controls .audio-progress {
    order: 2;
    margin-left: 1rem;
  }

  .content-area .tab-item .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Scrub Tooltip */
.scrub-tooltip {
  position: fixed;
  background: rgba(88, 41, 180, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 1000;
  transform: translateX(-50%);
  display: none;
}

.scrub-tooltip::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(88, 41, 180, 0.9);
}

.share-button {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.share-button:hover {
  transform: scale(1.05);
  background-color: #5829b4;
  border-color: #5829b4;
  color: white;
}

.share-button i {
  font-size: 1rem;
}

/* Form Styling */
.item-form-container {
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 2rem;
  max-width: 800px;
  margin: 2rem auto;
}

.item-form-container h1 {
  font-family: "Madimi One", sans-serif;
  color: #5829b4;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.item-form-container .form-group {
  margin-bottom: 1.5rem;
}

.item-form-container label {
  display: block;
  color: #495057;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.item-form-container input[type="text"],
.item-form-container textarea {
  width: 100%;
  padding: 0.25rem 1rem;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  font-size: 1rem;
  color: #495057;
  transition: border-color 0.2s ease;
}

.item-form-container input[type="text"]:focus,
.item-form-container textarea:focus {
  border-color: #5829b4;
  outline: none;
  box-shadow: 0 0 0 3px rgba(88, 41, 180, 0.1);
}

.item-form-container input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 2px dashed #e9ecef;
  border-radius: 0.5rem;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s ease;
}

.item-form-container input[type="file"]:hover {
  border-color: #5829b4;
  background: #f8f9fa;
}

.item-form-container .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

.item-form-container .btn {
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.item-form-container .btn-primary {
  background-color: #5829b4;
  border-color: #5829b4;
  color: white;
}

.item-form-container .btn-primary:hover {
  background-color: #4a1fa0;
  transform: translateY(-1px);
}

.item-form-container .btn-secondary {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  color: #6c757d;
}

.item-form-container .btn-secondary:hover {
  background-color: #e9ecef;
  color: #495057;
}

.upload-progress {
  margin-top: 1.5rem;
  display: none;
}

.upload-progress.visible {
  display: block;
}

.upload-progress .progress {
  height: 0.5rem;
  background-color: #e9ecef;
  border-radius: 1rem;
  overflow: hidden;
}

.upload-progress .progress-bar {
  height: 100%;
  background-color: #5829b4;
  transition: width 0.3s ease;
}

.upload-progress .progress-text {
  text-align: center;
  color: #6c757d;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Chat Styles */
#chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.chat-sidebar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: white;
  transform: translateX(-280px);
  transition: transform 0.3s ease-in-out;
  z-index: 1050;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  height: 100%;
  overflow-y: auto;
  display: none;
}

.chat-sidebar:not(.sidebar-hidden) {
  transform: translateX(0);
  display: block;
}

.chat-history {
  height: calc(100% - 100px);
  overflow-y: auto;
}

.chat-history-item {
  transition: background-color 0.2s ease;
}

.chat-history-item:hover {
  background-color: #f8f9fa;
}

.chat-main {
  border: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  transition: margin-left 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 0.5rem !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e9ecef;
  min-height: 40px;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  padding-bottom: 80px; /* Increased space for input */
}

#chat-messages-container {
  padding: 0.25rem;
  gap: 0.5rem;
}

/* Chat Input Styles */
.chat-input-container {
  position: absolute;
  bottom: -20px;
  left: 0px;
  right: 0px;
  padding: 0 20px;
  background: #fff;
  border-top: 1px solid #e9ecef;
  z-index: 1000;
}

.chat-input-container.keyboard-open {
  bottom: var(--keyboard-height);
}

.chat-input-container .input-group {
  position: relative;
  margin: 10px 0;
  padding-right: 35px; /* Reduced padding for smaller button */
}

.chat-input-container .form-control {
  border-radius: 1.5rem;
  padding: 8px 16px;
  border: 1px solid #dee2e6;
  min-height: 40px;
  max-height: 150px;
  overflow-y: auto;
  resize: none;
  width: 100%;
}

.chat-input-container .btn {
  border-radius: 50%;
  width: 44px; /* Further reduced from 32px */
  height: 44px; /* Further reduced from 32px */
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #5829b4;
  border-color: #5829b4;
  color: white;
  position: absolute;
  bottom: 0px; /* Adjust for vertical centering */
  right: 4px;
  z-index: 1001;
}

.chat-input-container .btn i {
  font-size: 0.75rem; /* Reduce icon size further */
}

.chat-input-container .btn:hover {
  background-color: #4a1fa0;
  border-color: #4a1fa0;
}

/* Mobile specific chat input */
@media (max-width: 576px) {
  .item-wrapper {
    height: calc(100svh - var(--nav-height) - env(safe-area-inset-bottom));
  }

  .item-content {
    padding: 10px;
  }

  #gc-messages {
    padding-bottom: 80px; /* Space for input + bottom nav */
  }

  /* .item-footer {
    margin-bottom: calc(var(--safe-area-bottom) + 50px);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 10px;
    z-index: 1000;
  } */

  .memori-detail {
    padding: 0.5rem;
  }

  .memori-detail h1 {
    font-size: 1.25rem;
  }

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

  .audio-player .player-controls #play-pause {
    width: 40px;
    height: 40px;
  }

  .audio-player .player-controls .time-display {
    order: 3;
    margin-top: 0.5rem;
  }

  .audio-player .player-controls .audio-progress {
    order: 2;
    margin-left: 1rem;
  }

  .content-area .tab-item .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Desktop specific chat input */
@media (min-width: 577px) {
  #tab-title {
    display: none;
  }

  .chat-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 0.75rem;
    border-top: 1px solid #e9ecef;
  }
}

.show-sidebar {
  display: block !important;
}

/* Message Styles */
.message {
  max-width: 95%;
  margin:auto;
}

.user-message {
  align-self: flex-end;
}

.assistant-message {
  align-self: flex-start;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
}

.user-message .message-content {
  background-color: #5829b4;
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.assistant-message .message-content {
  background-color: #f8f9fa;
  border-bottom-left-radius: 0.25rem;
}

.content-area .tab-content {
  height: 100%;
  position: relative;
}

.content-area .tab-pane {
  height: 100%;
  overflow-y: auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
}

/* Specific tab pane styles */
#speakers.tab-pane {
  display: flex;
  flex-direction: column;
}

#speakers-list {
  flex-grow: 1;
  overflow-y: auto;
}

#summary.tab-pane #summary-grid {
  height: 100%;
  overflow-y: auto;
}

#transcript.tab-pane .transcript-content {
  height: 100%;
  overflow-y: auto;
}


#chat.tab-pane {
  padding: 0;
}

/* Mobile specific adjustments */
@media (max-width: 576px) {
  #tab-title {
    padding: 0 1rem;
    font-family: "Madimi One", sans-serif;
    color: #5829b4;
    font-size: 1.25rem;
    margin-bottom: 0;
  }

  .chat-input-container {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    background: #fff;
    padding: 0.75rem 0.5rem;
    margin: 0;
    border-top: 1px solid #e9ecef;
    position: absolute;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e9ecef;
    width: 100%;
  }

  .chat-input-container .form-control {
    height: 44px;
    font-size: 16px;
    padding: 0.75rem 1rem;
  }

  .chat-input-container .btn {
    margin-top: 10px;
    width: 44px;
    height: 44px;
  }

  .chat-input-container.keyboard-open {
    bottom: 10;
  }
  .content-area {
    height: calc(svh - var(--nav-height) - 20px);
    margin-bottom: env(safe-area-inset-bottom);
  }

  .content-area .tab-navigation {
    position: fixed;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
    z-index: 100;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.75rem;
  }

  .chat-body {
    height: calc(svh - var(--nav-height) - 60px);
    padding-bottom: 140px; /* Increased space for input + bottom nav */
  }

  .chat-input-container .form-control {
    height: 44px; /* Slightly taller input on mobile */
    font-size: 16px; /* Prevent iOS zoom */
    padding: 0rem 0.5rem;
  }

  /* .chat-body.keyboard-open {
    height: calc(svh - var(--nav-height) - var(--keyboard-height));
    padding-bottom: 50px;
  }

  .chat-input-container.keyboard-open {
    bottom: calc(var(--keyboard-height) + 45px + env(safe-area-inset-bottom));
  } */

  .tab-label {
    display: none;
  }
}

/* Desktop specific adjustments */
@media (min-width: 577px) {
  .content-area .tab-navigation {
    position: static;
    box-shadow: none;
    padding: 0.5rem;
  }

  .tab-label {
    display: inline;
  }

  .chat-body {
    height: calc(100% - 50px); /* Account for chat header */
    padding-bottom: 60px; /* Space for input */
  }

  .chat-input-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 0.75rem;
    border-top: 1px solid #e9ecef;
  }
}

#content-area {
  transition: padding-top 0.5s ease;
}

#content-area.keyboard-open {
  padding-top: var(--nav-height) !important;
}

.player-controls {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: 1rem;
  align-items: center;
}

.player-controls button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.player-controls button.playing-clip {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}
