/**
 * Fluid Chat v2.0
 * Responsive chat layout that adapts fluidly to all screen sizes
 */

/* ==================== Fluid Layout ==================== */
.fluid-chat-layout {
  display: flex;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

.fluid-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: #0f172a;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fluid-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ==================== Mobile Adjustments ==================== */
@media screen and (max-width: 768px) {
  .fluid-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    width: 85%;
    max-width: 320px;
  }
  
  .fluid-sidebar.open {
    transform: translateX(0);
  }
  
  .fluid-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }
  
  .fluid-sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
  }
}

/* ==================== Fluid Header ==================== */
.fluid-header {
  height: 60px;
  padding: 0 16px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

@media screen and (max-width: 768px) {
  .fluid-header {
    height: 56px;
    padding: 0 12px;
  }
}

/* ==================== Fluid Messages ==================== */
.fluid-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

@media screen and (max-width: 768px) {
  .fluid-messages {
    padding: 12px;
    padding-bottom: 80px; /* Space for input */
  }
}

/* ==================== Fluid Input ==================== */
.fluid-input-area {
  padding: 12px 16px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

@media screen and (max-width: 768px) {
  .fluid-input-area {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
  }
}

/* ==================== Fluid Message Widths ==================== */
.fluid-message {
  max-width: 75%;
}

@media screen and (max-width: 768px) {
  .fluid-message {
    max-width: 85%;
  }
}

@media screen and (min-width: 1200px) {
  .fluid-message {
    max-width: 65%;
  }
}

/* ==================== Fluid Grid ==================== */
.fluid-grid {
  display: grid;
  gap: 16px;
}

.fluid-grid-1 {
  grid-template-columns: 1fr;
}

@media screen and (min-width: 480px) {
  .fluid-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 768px) {
  .fluid-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (min-width: 1024px) {
  .fluid-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==================== Fluid Spacing ==================== */
.fluid-p {
  padding: 16px;
}

.fluid-px {
  padding-left: 16px;
  padding-right: 16px;
}

.fluid-py {
  padding-top: 16px;
  padding-bottom: 16px;
}

@media screen and (max-width: 768px) {
  .fluid-p {
    padding: 12px;
  }
  
  .fluid-px {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .fluid-py {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* ==================== Fluid Typography ==================== */
.fluid-heading-xl {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
}

.fluid-heading-lg {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
}

.fluid-heading-md {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  line-height: 1.4;
}

.fluid-text {
  font-size: clamp(0.875rem, 2vw, 1rem);
  line-height: 1.5;
}

.fluid-text-sm {
  font-size: clamp(0.75rem, 1.5vw, 0.875rem);
  line-height: 1.5;
}

/* ==================== Fluid Hide/Show ==================== */
.fluid-hide-mobile {
  display: block;
}

.fluid-show-mobile {
  display: none;
}

@media screen and (max-width: 768px) {
  .fluid-hide-mobile {
    display: none !important;
  }
  
  .fluid-show-mobile {
    display: block !important;
  }
}

/* ==================== Fluid Container ==================== */
.fluid-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media screen and (max-width: 768px) {
  .fluid-container {
    padding: 0 12px;
  }
}

