/* =========================================================================
   CHATFLOW WHATSAPP CRM - MESSAGE TEMPLATES RESPONSIVE STYLES (templates.css)
   ========================================================================= */

#view-templates.view-pane.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.templates-header-bar {
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.templates-layout-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 1rem;
}

.templates-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  flex-shrink: 1;
  min-height: 0;
  padding-right: 4px;
}

.templates-inventory-card {
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* TABLE SCROLL WRAPPER */
.templates-table-wrapper {
  overflow-y: auto;
  overflow-x: auto;
  flex: 1;
  min-height: 0;
}

/* GLASSMORPHIC STATUS BADGES */
.badge-emerald {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.badge-rose {
  background: rgba(244, 63, 94, 0.15) !important;
  color: #fda4af !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
}

.badge-violet {
  background: rgba(139, 92, 246, 0.15) !important;
  color: #c084fc !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
}

/* RESPONSIVE STYLING */
@media (max-width: 1024px) {
  .templates-layout-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    align-items: start;
    gap: 1.25rem;
    padding-right: 2px;
  }
  
  .templates-sidebar {
    overflow-y: visible;
    flex-shrink: 0;
  }
  
  .templates-inventory-card {
    height: auto;
    min-height: 380px;
    max-height: 600px;
    flex-shrink: 0;
  }
  
  .templates-table-wrapper {
    max-height: 500px;
  }
}

@media (max-width: 640px) {
  .templates-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
  }
  
  .templates-header-bar p {
    margin-top: 0.35rem !important;
  }

  #templates-tenant-selector-group,
  #templates-tenant-display-badge {
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
  }

  .templates-layout-grid {
    gap: 1rem;
  }

  .templates-inventory-card {
    min-height: 320px;
  }
}
