/* --- START OF FILE style.css --- */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f7f6;
    color: #333;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: 95vh;
    overflow: hidden;
}

/* Header Section (Profile | Summary | Indicators) */
.summary-section {
    background-color: #e9ecef; 
    padding-top: 15px;    
    padding-bottom: 15px; 
    border-radius: 5px;
    margin-bottom: 20px; 
    display: flex;
    align-items: stretch; 
    gap: 0px; 
    flex-shrink: 0;
}
.profile-column {
    display: flex; flex-direction: row; align-items: center; gap: 15px; 
    flex-shrink: 0; min-width: 260px; 
    padding-left: 20px; padding-right: 20px; 
    border-right: 1px solid #d1d5db;
    justify-content: flex-start;
}
.profile-column img#profile-image { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); flex-shrink: 0; }
.profile-info { display: flex; flex-direction: column; justify-content: center; }
.profile-info h3 { margin: 0 0 4px 0; font-size: 1.05em; color: #333; font-weight: bold; }
.profile-info p { margin: 1px 0; font-size: 0.8em; color: #555; word-break: break-all; }
.summary-text-column { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; text-align: left; padding-left: 20px; padding-right: 20px; border-right: 1px solid #d1d5db; min-width: 0; }
.summary-text-column #summary-text { margin: 0; line-height: 1.5; font-size: 0.9em; }
.indicators-column { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; min-width: 80px; padding-left: 20px; padding-right: 20px; }
#sentiment-icon-container { font-size: 2.8em; line-height: 1; margin-bottom: 8px; }
.sentiment-icon-positive { color: #28a745; } .sentiment-icon-negative { color: #dc3545; } .sentiment-icon-neutral { color: #6c757d; } .sentiment-icon-unknown { color: #ffc107; }
.status-badge { color: white; padding: 5px 10px; border-radius: 12px; font-size: 0.8em; display: flex; align-items: center; font-weight: bold; }
.status-badge .checkmark, .status-badge .questionmark { font-size: 1em; margin-right: 5px; border: 1px solid white; border-radius: 50%; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.status-badge.identified { background-color: #28a745; } .status-badge.unknown { background-color: #ffc107; } .status-badge.initial-unknown { background-color: #6c757d; }


/* Membership & Flight Info Section Styling */
.membership-flight-info-section.single-line-info {
    display: flex;
    justify-content: space-between;
    align-items: center; 
    padding: 10px 20px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    flex-shrink: 0;
    white-space: nowrap; 
    overflow-x: auto; 
    font-size: 0.85em; 
}
.membership-details-inline, .upcoming-flight-inline {
    display: flex; 
    align-items: center;
    height: 100%;
}
.info-label, .info-value, .info-separator, .info-arrow, .takeoff-icon {
    display: inline-block;
    vertical-align: middle;
    line-height: normal;
}
.info-label { font-weight: bold; color: #555; margin-right: 4px; }
.info-value { color: #333; margin-right: 12px; }
.info-value:last-child { margin-right: 0; }
.info-separator { color: #bbb; margin: 0 8px; font-weight: lighter; }
.info-arrow { margin: 0 6px; color: #555; font-weight: bold; }
.info-value.tier-gold { color: #fff; background-color: #DAA520; padding: 2px 8px; border-radius: 10px; font-weight: bold;}
.info-value.tier-silver { color: #fff; background-color: #C0C0C0; padding: 2px 8px; border-radius: 10px; font-weight: bold;}
.info-value.tier-bronze { color: #fff; background-color: #CD7F32; padding: 2px 8px; border-radius: 10px; font-weight: bold;}
.info-value.tier-standard { color: #333; background-color: #e0e0e0; padding: 2px 8px; border-radius: 10px;}
.takeoff-icon { font-size: 1.4em; margin-right: 6px; }


/* Main Content Area */
.content-area { display: flex; gap: 20px; flex-grow: 1; overflow: hidden; }
.transcript-panel, .intents-panel, .action-panel, .entities-panel { background-color: #f8f9fa; padding: 15px; border-radius: 5px; border: 1px solid #dee2e6; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; min-width: 0; }
.transcript-panel { flex: 2 1 0%; }
.intents-panel { flex: 1 1 0%; }
.right-column-wrapper { flex: 1.5 1 0%; display: flex; flex-direction: column; gap: 15px; overflow: hidden; min-height: 0; box-sizing: border-box; }
.action-panel { flex: 0 0 auto; max-height: 200px; }
.entities-panel { flex: 1 1 auto; min-height: 0; }
h2 { margin-top: 0; font-size: 1.2em; color: #007bff; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; flex-shrink: 0; word-wrap: break-word; }
.transcript-log { overflow-y: auto; padding-right: 10px; flex-grow: 1; min-height: 0; }
.message-bubble { margin-bottom: 10px; padding: 10px 15px; border-radius: 18px; max-width: 85%; word-wrap: break-word; box-sizing: border-box; }
.message-bubble.user { background-color: #e9e9eb; color: #333; margin-left: 0; margin-right: auto; border-bottom-left-radius: 5px; }
.message-bubble.user .sender-info strong { color: #555; }
.message-bubble.ai { background-color: #d1ecf1; color: #0c5460; margin-left: auto; margin-right: 0; border-bottom-right-radius: 5px; }
.message-bubble.ai .sender-info strong { color: #004085; }
.sender-info { font-size: 0.9em; margin-bottom: 5px; display: flex; justify-content: space-between; }
.sender-info strong { font-weight: bold; }
.timestamp { font-size: 0.8em; color: #6c757d; margin-left: 10px; white-space: nowrap; }
.intents-flow { overflow-y: auto; flex-grow: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 0 5px; box-sizing: border-box; }
.intent-item { background-color: #cce5ff; border: 1px solid #b8daff; color: #004085; padding: 10px 15px; border-radius: 5px; margin-bottom: 5px; text-align: center; width: 90%; max-width: calc(100% - 10px); box-shadow: 0 2px 4px rgba(0,0,0,0.05); flex-shrink: 0; word-wrap: break-word; overflow-wrap: break-word; box-sizing: border-box; }
.intent-arrow { color: #6c757d; font-size: 1.5em; margin-bottom: 5px; flex-shrink: 0; }
.action-content { overflow-y: auto; flex-grow: 1; min-height: 0; padding-right: 10px; word-wrap: break-word; box-sizing: border-box; }
.action-content p { margin: 0; line-height: 1.6; padding-bottom: 5px; }
.entities-table-container { overflow-y: auto; flex-grow: 1; min-height: 0; }
.entities-panel table { width: 100%; border-collapse: collapse; }
.entities-panel th, .entities-panel td { border: 1px solid #ddd; padding: 8px; text-align: left; font-size: 0.9em; word-wrap: break-word; }
.entities-panel th { background-color: #e9ecef; font-weight: bold; position: sticky; top: 0; z-index: 1; }
.entities-panel tbody tr:nth-child(even) { background-color: #f8f9fa; }

/* --- NEW: STYLES FOR RICH CONTENT (MARKDOWN & ADAPTIVE CARDS) --- */

.message-body {
    line-height: 1.4;
}

/* This targets any image inside a message body */
.message-body img {
    display: block;
    max-width: 100%; /* This is the key property for resizing */
    height: auto;    /* This maintains the aspect ratio */
    border-radius: 8px; /* Optional: adds rounded corners to images */
    margin-top: 8px;    /* Optional: adds space between text and image */
}

/* This ensures paragraphs generated by Markdown don't have extra margins */
.message-body p {
    margin-top: 0;
    margin-bottom: 0.5em; /* Add a little space between paragraphs */
}

.message-body p:last-child {
    margin-bottom: 0; /* No space after the very last paragraph */
}

/* This ensures Adaptive Cards fit nicely inside the bubble */
.ac-adaptiveCard {
    padding: 5px !important; /* Override default padding */
    background-color: transparent !important; /* Let the bubble control the background */
    width: 100%;
    box-sizing: border-box;
}

/* Remove extra padding from card containers inside the bubble */
.message-body .ac-container {
    padding: 0;
}

.adaptive-card-wrapper {
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6); /* Slightly brighter overlay */
    display: inline-block;
    max-width: 100%;
    margin-top: 4px;
}

.adaptive-card-wrapper .ac-adaptiveCard {
    width: 100%;
}

/* Property Maintenance strip styling */
.property-maintenance-strip .takeoff-icon {
  font-size: 1.2em;
  margin-right: 4px;
}
.property-maintenance-strip {
  border-left: 4px solid #4cafef; /* light blue accent */
  padding-left: 8px;
}


/* Keep label/value pairs together */
.kv { display: inline-flex; align-items: baseline; gap: 4px; }
@media (max-width: 768px) {
  .membership-flight-info-section.single-line-info { row-gap: 6px; }
  .membership-flight-info-section.single-line-info .kv { display: inline-flex; gap: 4px; }
}


/* =========================
   RESPONSIVE ENHANCEMENTS
   ========================= */

/* Medium screens: tighten spacing, slightly smaller fonts */
@media (max-width: 1200px) {
  .container { max-height: none; overflow: visible; }
  .summary-text-column #summary-text { font-size: 0.85em; }
  h2 { font-size: 1.1em; }
  .intent-item, .entities-panel th, .entities-panel td, .action-content { font-size: 0.9em; }
}

/* Tablet & small laptop */
@media (max-width: 992px) {
  body { padding: 12px; }
  .summary-section { gap: 10px; }
  .profile-column { min-width: 200px; padding-left: 10px; padding-right: 10px; }
  .summary-text-column { padding-left: 10px; padding-right: 10px; }
  .indicators-column { min-width: 70px; padding-left: 10px; padding-right: 10px; }
  #sentiment-icon-container { font-size: 2.2em; }
  .membership-flight-info-section.single-line-info { font-size: 0.8em; }
}

/* Phones (portrait) */
@media (max-width: 768px) {
  html, body { height: auto; }
  body { padding: 8px; }
  .container { padding: 12px; max-height: none; overflow: visible; }
  
  /* Header stacks vertically */
  .summary-section { 
    flex-direction: column; 
    align-items: stretch;
  }
  .profile-column { 
    border-right: none; 
    border-bottom: 1px solid #d1d5db; 
    min-width: 0; 
    gap: 12px;
  }
  .profile-column img#profile-image { width: 56px; height: 56px; }
  .profile-info h3 { font-size: 1em; }
  .profile-info p { font-size: 0.75em; }
  .summary-text-column { 
    border-right: none; 
    padding-top: 10px; 
    padding-bottom: 10px; 
  }
  .summary-text-column #summary-text { font-size: 0.9em; }
  .indicators-column { 
    flex-direction: row; 
    justify-content: flex-start; 
    gap: 12px; 
    padding-top: 6px; 
    padding-bottom: 6px;
  }
  #sentiment-icon-container { font-size: 1.8em; margin-bottom: 0; }
  .status-badge { font-size: 0.75em; }
  
  /* Info strip becomes wrapping grid */
  .membership-flight-info-section.single-line-info {
    white-space: normal;
    overflow-x: visible;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 6px;
    font-size: 0.8em;
  }
  .membership-details-inline, .upcoming-flight-inline { 
    flex-wrap: wrap; 
    gap: 4px 8px;
  }
  
  /* Main content stacks */
  .content-area { 
    flex-direction: column; 
    gap: 12px; 
    overflow: visible;
  }
  .transcript-panel, .intents-panel, .action-panel, .entities-panel {
    padding: 12px;
  }
  
  /* Reorder blocks: Transcript, Action, Intents, Entities */
  .transcript-panel { order: 1; }
  .right-column-wrapper { order: 2; }
  .action-panel { order: 1; } /* inside right-column-wrapper */
  .intents-panel { order: 3; }
  .entities-panel { order: 4; }

  /* Make bubbles full width */
  .message-bubble { max-width: 100%; }
  .sender-info { font-size: 0.85em; }
  .timestamp { font-size: 0.7em; }

  h2 { font-size: 1em; }
  .intent-item { width: 100%; font-size: 0.9em; }
  .intent-arrow { font-size: 1.2em; }
  
  /* Tables scroll instead of overflowing */
  .entities-table-container { overflow-x: auto; }
  .entities-panel table { min-width: 480px; }
  .entities-panel th, .entities-panel td { font-size: 0.85em; padding: 6px; }
}

/* Very small phones */
@media (max-width: 375px) {
  .profile-info h3 { font-size: 0.95em; }
  .profile-info p { font-size: 0.7em; }
  .summary-text-column #summary-text { font-size: 0.85em; }
  .membership-flight-info-section.single-line-info { font-size: 0.75em; }
  .intent-item { font-size: 0.85em; }
  .entities-panel th, .entities-panel td { font-size: 0.8em; }
}
