/* ============================================================================
   MAIN LAYOUT CONTAINER
   ============================================================================ */

.resizable-container {
  display: flex;
  width: 100%;
  height: calc(100vh - 2rem);
  min-height: 500px;
}

/* ============================================================================
   CHAT PANEL
   ============================================================================ */

.chat-panel2 {
  flex: 0 0 33%;
  min-width: 250px;
  max-width: 70%;
  border-right: 1px solid #dee2e6;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

.chat-messages {
  /* Chat messages styles are defined in main style.css */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
}

/* ============================================================================
   MAP PANEL
   ============================================================================ */

.map-panel {
  flex: 1;
  min-width: 30%;
  overflow: hidden;
  position: relative;
}

/* ============================================================================
   DIVIDER HANDLE
   ============================================================================ */

.divider {
  width: 1px;
  background: var(--teal-1);
  cursor: col-resize;
  position: relative;
  flex: 0 0 1px;
  margin-left: 0.5rem;
  top: 0.1rem;
  max-height: calc(100vh - 14rem);
  transition: background-color 0.2s ease;
}

.divider:hover {
  background: var(--teal-20);
  box-shadow: var(--card-shadow-active);
}

.divider-handle {
  position: relative;
  top: 50%;
  left: -2px;
  width: 5px;
  height: 3rem;
  background: var(--main-black);
  border: 1px solid var(--teal-1);
  border-radius: 0.125rem;
}

.divider:hover .divider-handle {
  background: var(--teal-20);
  box-shadow: var(--card-shadow-active);
}
/* ============================================================================
   CONVERSATION BUTTONS
   ============================================================================ */

.new-chat-btn {
  position: absolute;
  bottom: 0rem;
  right: 1.25rem;
  z-index: 1000;
  font-size: 2.25rem;
  border-radius: 2rem;
  background-color: var(--teal-0) !important;
}

.delete-converation-btn {
  padding: 0.1rem 0.25rem;
  border: 1px solid var(--teal-0);
}

.delete-converation-btn:hover {
  background: var(--teal-20);
  box-shadow: var(--card-shadow-active);
}

.delete-converation-btn:active {
  background: var(--teal-20);
  box-shadow: var(--card-shadow-active);
  transform: scale(0.95);
}

/* ============================================================================
   CONVERSATION HISTORY TABLE
   ============================================================================ */

.conversation-history-table {
  font-size: 0.75rem;
  color: var(--brown-20);
}

.conversation-history-table.table-sm > :not(caption) > * > * {
  padding: 0rem;
}
/* ============================================================================
   RESPONSIVE DESIGN - MOBILE TABS
   ============================================================================ */

/* Tablet and larger mobile - keep existing layout */
@media (max-width: 992px) and (min-width: 769px) {
  .resizable-container {
    height: calc(100vh - 8rem);
  }
  
  /* Improved touch targets for divider */
  .divider {
    width: 5px; /* Thicker for easier touch */
    background: var(--teal-10);
  }
  
  .divider-handle {
    width: 10px;
    height: 4rem;
    left: -2.5px; /* Center the larger handle */
  }
}

/* Mobile - Tab-based layout */
@media (max-width: 768px) {
  .resizable-container {
    height: calc(100vh - 4rem - 8rem); /* navbar (4rem) + footer/input (8rem for safe margin) */
    position: relative;
  }
  #chat-container{
    margin-left: 0.25rem;
    margin-right: 0.25rem;
  }
  /* Mobile tab navigation */
  .mobile-tabs {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--main-black);
    padding: 0.5rem 0.75rem 0;
    gap: 0.5rem;
  }
  
  .mobile-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    text-align: center;
    background: #0000;
    color:var(--brown-20);
    cursor: pointer;
    border: none;
    font-size: 0.85rem;
    border-radius: 1rem 1rem 0 0;
    box-shadow: var(--card-shadow);
    /* NO transitions to stop pulsing */
  }
  
  .mobile-tab.active {
    background: var(--teal-0);
    color:var(--secondary-black)!important;
    animation: none!important;
  }
  
  
  
  /* Panel adjustments for tabs */
  .chat-panel, .map-panel {
    position: absolute;
    top: 2.5rem; /* Reduced space for shorter tabs */
    left: 0;
    right: 0;
    bottom: 0;
    /* Prevent any animations */
    animation: none !important;
    transition: none !important;
  }
  
  .chat-panel {
    border-right: none;
    opacity: 1;
    visibility: visible;
    z-index: 10;
  }
  
  .map-panel {
    opacity: 0;
    visibility: hidden;
    z-index: 5;
    /* Ensure map panel has same height constraints as chat */
    height: calc(100vh - 4rem - 8rem - 2.5rem); /* navbar + footer + shorter tabs */
    overflow: hidden;
  }
  
  .map-panel.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
  }
  
  .chat-panel:not(.active) {
    opacity: 0;
    visibility: hidden;
    z-index: 5;
  }
  
  /* Hide divider on mobile */
  .divider {
    display: none;
  }
  
  .chat-messages {
    padding: 1rem 0.75rem;
    height: calc(100vh - 4rem - 8rem - 2.5rem); /* navbar + footer + shorter tabs */
    overflow-y: auto;
  }
  
  /* Ensure all child elements have no animations */
  .mobile-tabs .chat-panel *,
  .mobile-tabs .map-panel *,
  .mobile-tab * {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================================
   CHAT FEEDBACK UI - SCALABLE DESIGN FOR NARROW PANES
   ============================================================================ */

.output-disclaimer {
  margin-left: 1.25rem !important;
  margin-right: 1.25rem !important;
  margin-top: 0rem !important;
  margin-bottom: 1rem !important;
}
.chat-feedback-container {
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  background: var(--teal-0-transparent);
  border-radius: 0.5rem;
  box-shadow: var(--card-shadow);
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feedback-title {
  font-weight: 600;
  color: var(--brown-20);
  font-size: 0.9rem;
  margin: 0;
}

.feedback-submit {
  white-space: nowrap;
  min-width: auto;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  margin-left: 0.75rem;
  box-shadow: var(--card-shadow);
}

.feedback-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feedback-form {
  border-radius: 0.375rem;
  padding: 0.15rem;
  border: 1px solid #0000;
  transition: all 0.2s ease;
  margin-right: 0.75rem;
  margin-left: 0.75rem;
}

.feedback-row-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.feedback-icon {
  color: var(--teal-20);
  font-size: 1rem;
  min-width: 1.2rem;
  text-align: center;
}

.feedback-label {
  font-weight: 500;
  color: var(--brown-20);
  font-size: 0.85rem;
  margin: 0;
}

.feedback-row-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feedback-stars {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.feedback-stars .star {
  color: #ddd;
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.2s ease, transform 0.1s ease;
  user-select: none;
}

.feedback-stars .star:hover {
  transform: scale(1.1);
}

.feedback-stars .star.highlighted {
  color: #ffc107;
}

.feedback-input {
  font-size: 0.85rem;
  border-radius: 0.25rem;
  border: 1px solid #ddd;
  transition: border-color 0.2s ease;
  box-shadow: var(--card-shadow);
}

.feedback-input:focus {
  border-color: var(--teal-0, #2c5aa0);
  box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

.feedback-message {
  font-size: 0.75rem;
  color: var(--gray-10);
  margin: 0.5rem 0.75rem 0;
  line-height: 1.4;
}

/* ============================================================================
   RESPONSIVE FEEDBACK DESIGN
   ============================================================================ */

/* Narrow chat panes */
@media (max-width: 576px) {
  .feedback-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .feedback-submit {
    min-width: 120px;
    box-shadow: var(--card-shadow);
  }
  
  .feedback-form {
    padding: 0.5rem;
  }
  
  .feedback-stars .star {
    font-size: 1.1rem;
  }
}

/* Extra narrow chat panes */
@media (max-width: 400px) {
  .chat-feedback-container {
    padding: 0.75rem 0;
  }
  
  .feedback-header {
    padding: 0 0.5rem;
  }
  
  .feedback-form {
    padding: 0.5rem;
    margin: 0 0.25rem;
  }
  
  .feedback-row-content {
    gap: 0.375rem;
  }
  
  .feedback-stars {
    justify-content: center;
  }
  
  .feedback-stars .star {
    font-size: 1rem;
    gap: 0.125rem;
  }
}

/* Compact mode for very narrow panes */
@media (max-width: 300px) {
  .feedback-title {
    font-size: 0.8rem;
  }
  
  .feedback-submit {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    min-width: 100px;
  }
  
  .feedback-label {
    font-size: 0.8rem;
  }
  
  .feedback-input {
    font-size: 0.8rem;
    padding: 0.375rem 0.5rem;
  }
  
  .feedback-stars .star {
    font-size: 0.9rem;
  }
}

/* ============================================================================
   DISABLED STATE STYLING
   ============================================================================ */

.feedback-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.feedback-disabled .feedback-form {
  background: #f8f9fa;
  border-color: #e9ecef;
}

.feedback-disabled .feedback-input {
  background: #f8f9fa;
  color: var(--gray-10);
}

/* ============================================================================
   MOBILE OPTIMIZATIONS
   ============================================================================ */

@media (max-width: 768px) {
  /* Optimize CDU modal for mobile */
  #cdu-details-modal {
    max-width: calc(100vw - 2rem);
    min-width: 250px;
  }
}

@media (max-width: 576px) {
  /* Compact CDU modal for small screens */
  #cdu-details-modal {
    min-width: 200px;
    font-size: 0.85rem;
  }
  
  #cdu-details-modal .cdu-modal-header h6 {
    font-size: 0.9rem;
  }
}