/* ============================================================================
   SHARED INPUT BOX STYLES - Used across Home, Project Detail, etc.
   ============================================================================ */

:root {
  /* Border radius */
  --radius-xs: clamp(4px, 0.5vw, 6px);
  --radius-sm: clamp(6px, 0.8vw, 8px);
  --radius-md: clamp(8px, 1.2vw, 12px);
  --radius-lg: clamp(16px, 2.3vw, 22px);
  --radius-full: 9999px;

  /* Padding */
  --padding-top: clamp(10px, 1.5vw, 14px);
  --padding-sides: clamp(10px, 1.5vw, 14px);
  --padding-bottom: clamp(8px, 1.2vw, 11px);
}

/* ============================================================================
   SHARED INPUT SHELL - Single Line Design
   ============================================================================ */

.furo-input-bar {
  position: relative;
  width: 100%;
  background: #fff;
  border: 0.5px solid #1C72F3;
  border-radius: var(--radius-lg);
  padding: var(--padding-top) var(--padding-sides) var(--padding-bottom);
  margin: 0 auto;
}

.furo-input-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.furo-input-shell.drag {
  background: rgba(28, 114, 243, 0.05);
  border-radius: var(--radius-md);
}

/* Textarea */
.furo-input-shell textarea {
  width: 100%;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: clamp(48px, 8vh, 56px);
  max-height: clamp(140px, 25vh, 220px);
  line-height: 1.5;
  padding: 0.5rem 0.75rem;
  resize: none;
  overflow-y: hidden;
  scrollbar-width: thin;
  transition: height 0.12s ease-out;
  font-size: clamp(14px, 1.5vw, 16px);
}

.furo-input-shell textarea::-webkit-scrollbar {
  width: 6px;
}

.furo-input-shell textarea::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0);
  border-radius: 6px;
}

.furo-input-shell textarea.scrolling::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.35);
}

.furo-input-shell textarea:focus {
  outline: none;
}

/* Attachment zone */
.furo-attach-zone {
  min-height: 0;
  flex-wrap: wrap;
  display: none;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.furo-attach-zone:not(:empty) {
  padding: 0.1rem 0;
  display: flex !important;
}

/* Bottom action row */
.furo-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 2vw, 1rem);
  padding: 0.25rem 0;
}

.furo-actions-left,
.furo-actions-right {
  display: flex;
  align-items: center;
}

/* Icon buttons */
.furo-icon-btn,
.furo-icon-btn-primary {
  width: clamp(35px, 8vw, 30px);
  height: clamp(35px, 8vw, 30px);
  min-width: 25px;
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.furo-icon-btn {
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.furo-icon-btn i,
.furo-icon-btn svg {
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: #0B2F4E;
  width: 25px;
  height: 25px;
  /* outline: 0.5px solid transparent; */
  border: 0.5px solid transparent;
}

.furo-icon-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  /* background: #F1F7FF; */
  border-radius: var(--radius-sm);
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 0;
  /* outline: 0.5px solid rgba(27, 145, 248, 0.4); */
  border: 0.5px solid rgba(27, 145, 248, 0.4);
}

.furo-icon-btn:hover::before {
  opacity: 1;
}

.furo-icon-btn > * {
  position: relative;
  z-index: 1;
}

.furo-icon-btn.listening {
  background: #E8F1FF;
}

.furo-icon-btn.listening i,
.furo-icon-btn.listening svg {
  color: #0071E3;
  animation: pulse 1.5s infinite;
}

.furo-icon-btn-primary {
  background: #0B2F4E;
}

.furo-icon-btn-primary i,
.furo-icon-btn-primary svg {
  color: white;
  width: 28px;
  height: 28px;
}

.furo-icon-btn-primary:hover {
  background: #0a2742;
}

.furo-icon-btn-primary:active {
  background: #08243B;
  transform: scale(0.96);
}

/* File chips */
.furo-file-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-md);
  padding: 4px;
  max-width: 280px;
  min-width: 200px;
  transition: all 0.2s ease;
  background: transparent !important;
  border: 0.5px solid #1B91F880 !important;
}

/* Images should have NO border and NO padding on parent */
.furo-file-chip:has(img:only-child),
.furo-file-chip:has(> img) {
  border: none !important;
  padding: 0 !important;
  min-width: auto !important;
  max-width: none !important;
  gap: 0 !important;
  background: transparent !important;
}

.furo-file-chip img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: zoom-in !important;
  display: block;
}

.furo-file-chip:hover img {
  opacity: 0.95;
}

.furo-file-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border-radius: var(--radius-sm);
}

/* Position remove button based on content type */
.furo-chip-remove {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* For image chips - position at top-right of image */
.furo-file-chip:has(img) .furo-chip-remove {
  top: -8px;
  right: -8px;
}

/* For document chips - position at top-right of chip */
.furo-file-chip:has(.furo-file-placeholder) .furo-chip-remove {
  top: -10px;
  right: -10px;
}

.furo-chip-remove:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Model selector integration */
.furo-model-selector {
  display: flex;
  align-items: center;
}

.furo-model-selector .model-selector:hover {
  background-color: #F1F7FF;
  inset: 1px;
  border-radius: var(--radius-sm);
}

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

@media (max-width: 576px) {
  .furo-input-bar {
    padding: 10px;
  }

  .furo-input-shell textarea {
    min-height: 48px;
    max-height: 120px;
    font-size: 15px;
    padding: 0.5rem;
  }

  .furo-bottom-row {
    gap: 0.5rem;
  }

  .furo-actions-left {
      gap: 0.5rem;
  }

  .furo-icon-btn,
  .furo-icon-btn-primary {
    width: 36px;
    height: 36px;
  }

  .furo-file-chip img {
    width: 50px;
    height: 50px;
  }

  .furo-chip-remove {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }
}

@media (max-width: 375px) {
  .furo-input-bar {
    padding: 8px;
  }

  .furo-icon-btn,
  .furo-icon-btn-primary {
    width: 34px;
    height: 34px;
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Home icon system */
.home-icon {
  width: 25px;
  height: 25px;
  display: block;
  pointer-events: none;
  user-select: none;
  color: var(--icon-color, #0B2F4E);
  transition: color 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}

/* Image modal */
.home-image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.home-image-modal.show {
  display: flex;
}

.home-image-modal img {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  object-fit: contain;
}

.home-image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  line-height: 1;
}

@media (max-width: 576px) {
  .home-image-modal img {
    max-width: 95vw;
    max-height: 95vh;
  }

  .home-image-modal-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 2rem;
  }
}


#voiceButton:focus,
#voiceButton:active,
#voiceButton:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

#voiceButton.listening {
    background: #E8F1FF !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}


.upload-container {
    position: relative !important;
}

/* Dropdown panel */
.add-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 270px;
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 6px;
    z-index: 1002;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.add-menu.show {
    display: flex;
}

/* Each row */
.add-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 10px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.add-item:hover {
    border-color: rgba(27, 145, 248, 0.35);
}

.add-item--disabled {
    cursor: not-allowed;
    pointer-events: none;
}

/* Icon box */
.add-item__icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    border-radius: 8px;
    font-size: 16px;
    color: #374151;
}

/* Text block */
.add-item__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.add-item__title {
    font-size: 13px;
    font-weight: 400;
    color: #111827;
    line-height: 1.3;
}

.add-item__desc {
    font-size: 11px;
    color: #6B7280;
    line-height: 1.4;
}

/* Checkmark for active state */
.add-item__check {
    font-size: 16px;
    color: var(--accent, #7c3aed);
    flex-shrink: 0;
}

/* Active row (web crawl on) */
.add-item.is-active .add-item__icon {
    background: color-mix(in srgb, var(--accent, #7c3aed) 12%, transparent);
    color: var(--accent, #7c3aed);
}

.add-item.is-active .add-item__title {
    color: var(--accent, #7c3aed);
}

@media (max-width: 768px) {
    .add-menu {
        width: 240px;
    }
}
