/* /public/styles/apothecaryAssistant.css */
/* Apothecary Assistant — chat + embedded doc */

/* =========================================
   1. APOTHECARY CHAT LAYOUT
   ========================================= */

/* The Main Column */
#app .rc-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  min-height: 75vh;
}

#app .apoth-tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 10px;
}

/* Messages Pane */
#app .chat-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0.5rem;
  padding: 1rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

/* 2. THE FORM (Strict CSS Rules)
   Targeting by ID (#aromatherapyComposer, #aromatherapyChatForm) 
   to win specificity wars against Pixel.
*/

#aromatherapyComposer, 
#aromatherapyChatForm,
.apoth-iso-form {
  display: flex !important;
  flex-direction: column !important; /* Force Vertical Stack */
  gap: 15px !important;
  width: 100% !important;
  margin-top: 10px;
  background: transparent;
}

/* The Input Field (Huge & Clean) */
#aromatherapyInput,
#aromatherapyChatInput,
.apoth-iso-input {
  display: block !important;
  width: 100% !important;        /* Force full width */
  min-width: 100% !important;    /* Double tap for safety */
  min-height: 100px !important;  /* Good height for mobile dictation */
  padding: 15px !important;
  
  border: 1px solid #b08a48 !important;
  border-radius: 0.5rem !important;
  background: #ffffff !important;
  color: #333 !important;
  font-size: 16px !important;    /* Prevents zoom on iPhone */
  resize: none !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.apoth-iso-input:focus,
#aromatherapyInput:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(176, 138, 72, 0.2);
}

/* The Buttons Container */
.apoth-iso-buttons {
  display: flex !important;
  flex-direction: row !important; /* Buttons sit side-by-side */
  width: 100% !important;
  gap: 10px !important;
  justify-content: space-between !important;
}

/* The Buttons Themselves */
.apoth-iso-buttons .credit-button {
  flex: 1 !important; /* Equal width */
  height: 50px !important; /* Nice touch target */
  border-radius: 0.5rem !important;
  font-size: 1rem !important;
  font-weight: 600;
  cursor: pointer;
  
  /* Reset default styles */
  background: #fff;
  border: 1px solid #b08a48;
  color: #b08a48;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

/* Primary "Send" Button Style */
#aromatherapyChatSend,
#aromatherapySend {
  background: #b08a48 !important;
  color: #fff !important;
}

#aromaRecord:active,
#aromatherapyChatRecord:active,
#aromatherapySend:active {
  transform: scale(0.98);
}

/* =========================================
   3. RIGHT RAIL (Desktop Doc Preview)
   ========================================= */
#photoPreview.apoth-preview {
  padding: 0;
}

#photoPreview .doc-frame,
#photoPreview #summaryFrame,
#summaryFrame {
  display: block;
  width: 100% !important;
  height: 78vh;
  border: 1px solid #b08a48;
  border-radius: 0.5rem;
  background: #fff;
}

#photoPreview .doc-open-link {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
  border: 1px solid #b08a48;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  color: #b08a48;
}

/* Small screens: Hide doc preview, focus on chat */
@media (max-width: 991.98px) {
  #app .chat-scroll { max-height: 60vh; }
  #photoPreview .doc-frame { min-height: 300px; height: auto; }
}

/* =========================================
   4. ARTIST ASSISTANT (Legacy Support)
   ========================================= */
#artistChatForm.composer {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

#artistChatForm .composer__input {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #b08a48;
  border-radius: .5rem;
  padding: .5rem .75rem;
  resize: vertical;
}

#artistChatForm .composer__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .25rem;
}

#artistChatForm .composer__actions .credit-button {
  font-size: .9rem;
  line-height: 1.2;
  padding: .25rem .5rem;
  border-radius: .5rem;
}

#artistChatForm .composer__preview {
  border: 1px solid #b08a48;
  border-radius: .5rem;
  padding: .5rem;
  background: #fff;
}

#artistChatForm .composer__thumb {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: .5rem;
  border: 1px solid rgba(0,0,0,.1);
}