/*
 * HAIRA AI Attachment Panel V8
 * Menu attachment dipindah ke body agar tidak bertabrakan
 * dengan composer dan kartu prompt.
 */

/* ========================================
   INPUT FILE BAWAAN
======================================== */

input[type="file"].haira-file-input,
form.composer input[type="file"] {
  position: fixed !important;
  top: -99999px !important;
  left: -99999px !important;

  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;

  width: 1px !important;
  height: 1px !important;

  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;

  pointer-events: none !important;
}

/* ========================================
   HILANGKAN SCROLLBAR ABU-ABU
======================================== */

.chat-panel {
  scrollbar-width: none !important;
}

.chat-panel::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

body.haira-attachment-open .chat-panel {
  overflow: hidden !important;
}

/* ========================================
   BACKDROP
======================================== */

.haira-attachment-backdrop {
  position: fixed;
  z-index: 9997;

  inset: 0;

  visibility: hidden;
  opacity: 0;

  background:
    rgba(0, 0, 0, 0.48);

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  pointer-events: none;

  transition:
    opacity 160ms ease,
    visibility 160ms ease;
}

.haira-attachment-backdrop.is-visible {
  visibility: visible;
  opacity: 1;

  pointer-events: auto;
}

/* ========================================
   MENU YANG SUDAH DIPINDAH KE BODY
======================================== */

body > .haira-attachment-menu.haira-sheet-ready {
  position: fixed !important;
  z-index: 9999 !important;

  top: var(
    --haira-attachment-menu-top,
    auto
  ) !important;

  right: 14px !important;
  bottom: auto !important;
  left: 14px !important;

  display: grid !important;

  grid-template-columns:
    repeat(2, minmax(0, 1fr)) !important;

  width: auto !important;
  max-width: 430px !important;
  height: auto !important;
  max-height: min(420px, 54vh) !important;

  margin:
    0
    auto !important;

  padding: 12px !important;
  gap: 8px !important;

  overflow-x: hidden !important;
  overflow-y: auto !important;

  visibility: hidden !important;
  opacity: 0 !important;

  border:
    1px solid rgba(58, 181, 255, 0.25) !important;

  border-radius: 22px !important;

  background:
    linear-gradient(
      145deg,
      rgba(20, 163, 255, 0.085),
      rgba(255, 214, 0, 0.045)
    ),
    rgba(7, 11, 17, 0.995) !important;

  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.8),
    0 0 42px rgba(0, 151, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;

  backdrop-filter:
    blur(30px)
    saturate(135%);

  -webkit-backdrop-filter:
    blur(30px)
    saturate(135%);

  pointer-events: none !important;

  transform:
    translateY(10px)
    scale(0.97) !important;

  transform-origin:
    bottom center !important;

  transition:
    opacity 160ms ease,
    visibility 160ms ease,
    transform 160ms ease !important;
}

body >
.haira-attachment-menu.haira-sheet-ready.is-open {
  visibility: visible !important;
  opacity: 1 !important;

  pointer-events: auto !important;

  transform:
    translateY(0)
    scale(1) !important;
}

/* ========================================
   HEADER PANEL
======================================== */

.haira-attachment-menu-header {
  display: flex;
  grid-column: 1 / -1;

  align-items: center;
  justify-content: space-between;

  min-height: 40px;

  padding:
    0
    2px
    4px;

  border-bottom:
    1px solid rgba(255, 255, 255, 0.07);
}

.haira-attachment-menu-title {
  display: flex;
  flex-direction: column;
  gap: 2px;

  min-width: 0;
}

.haira-attachment-menu-title strong {
  color: #ffffff;

  font-size: 14px;
  line-height: 1.3;
}

.haira-attachment-menu-title small {
  color: #828d9a;

  font-size: 9px;
  line-height: 1.3;
}

.haira-attachment-menu-close {
  position: static !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  flex: 0 0 32px !important;

  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;

  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;

  margin: 0 !important;
  padding: 0 !important;

  border:
    1px solid rgba(255, 255, 255, 0.1) !important;

  border-radius: 10px !important;

  color: #c8ced6 !important;

  background:
    rgba(255, 255, 255, 0.035) !important;

  box-shadow: none !important;

  font-size: 19px !important;
  line-height: 1 !important;

  cursor: pointer !important;
}

.haira-attachment-menu-close:hover {
  color: #ffffff !important;

  background:
    rgba(255, 255, 255, 0.075) !important;
}

/* ========================================
   PILIHAN FILE
======================================== */

body >
.haira-attachment-menu
button.haira-attachment-option {
  position: static !important;

  display: grid !important;

  grid-template-columns:
    40px minmax(0, 1fr) !important;

  align-items: center !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  height: auto !important;
  min-height: 70px !important;
  max-height: none !important;

  margin: 0 !important;
  padding: 10px !important;
  gap: 10px !important;

  border:
    1px solid rgba(255, 255, 255, 0.085) !important;

  border-radius: 15px !important;

  color: #f3f6f9 !important;

  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.045),
      rgba(255, 255, 255, 0.015)
    ),
    rgba(8, 12, 18, 0.97) !important;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;

  text-align: left !important;

  cursor: pointer !important;
  transform: none !important;
}

body >
.haira-attachment-menu
button.haira-attachment-option:hover,
body >
.haira-attachment-menu
button.haira-attachment-option:focus-visible {
  border-color:
    rgba(42, 178, 255, 0.3) !important;

  background:
    linear-gradient(
      145deg,
      rgba(42, 178, 255, 0.1),
      rgba(255, 214, 0, 0.035)
    ),
    rgba(9, 14, 20, 0.99) !important;

  outline: none !important;
}

/* ========================================
   IKON
======================================== */

body >
.haira-attachment-menu
.haira-attachment-option-icon {
  position: static !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  flex: 0 0 40px !important;

  width: 40px !important;
  height: 40px !important;

  border-radius: 13px !important;

  opacity: 1 !important;
  filter: none !important;
}

/* Foto dan video */

body >
.haira-attachment-menu
.haira-attachment-option:nth-of-type(1)
.haira-attachment-option-icon,
body >
.haira-attachment-menu
.haira-attachment-option:nth-of-type(3)
.haira-attachment-option-icon {
  color: #31b6ff !important;

  border:
    1px solid rgba(49, 182, 255, 0.35) !important;

  background:
    rgba(49, 182, 255, 0.11) !important;
}

/* Dokumen dan file */

body >
.haira-attachment-menu
.haira-attachment-option:nth-of-type(2)
.haira-attachment-option-icon,
body >
.haira-attachment-menu
.haira-attachment-option:nth-of-type(4)
.haira-attachment-option-icon {
  color: #ffd600 !important;

  border:
    1px solid rgba(255, 214, 0, 0.34) !important;

  background:
    rgba(255, 214, 0, 0.095) !important;
}

body >
.haira-attachment-menu
.haira-attachment-option-icon svg {
  display: block !important;

  width: 21px !important;
  height: 21px !important;

  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;

  opacity: 1 !important;
}

body >
.haira-attachment-menu
.haira-attachment-option-icon svg * {
  fill: none !important;
  stroke: currentColor !important;

  opacity: 1 !important;

  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* ========================================
   TEKS PILIHAN
======================================== */

body >
.haira-attachment-menu
.haira-attachment-option-text {
  position: static !important;

  display: flex !important;
  flex-direction: column !important;

  min-width: 0 !important;
}

body >
.haira-attachment-menu
.haira-attachment-option-text strong {
  display: block !important;

  overflow: hidden !important;

  color: #f8f9fb !important;

  font-size: 12px !important;
  line-height: 1.3 !important;

  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body >
.haira-attachment-menu
.haira-attachment-option-text small {
  position: static !important;

  display: block !important;

  width: 100% !important;
  max-width: 100% !important;

  margin-top: 4px !important;

  overflow: hidden !important;

  color: #87919e !important;

  font-size: 9px !important;
  line-height: 1.3 !important;

  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 430px) {
  body >
  .haira-attachment-menu.haira-sheet-ready {
    right: 12px !important;
    left: 12px !important;

    max-width: none !important;

    padding: 11px !important;
    gap: 7px !important;

    border-radius: 20px !important;
  }

  body >
  .haira-attachment-menu
  button.haira-attachment-option {
    grid-template-columns:
      36px minmax(0, 1fr) !important;

    min-height: 63px !important;

    padding: 9px !important;
    gap: 9px !important;
  }

  body >
  .haira-attachment-menu
  .haira-attachment-option-icon {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
  }

  body >
  .haira-attachment-menu
  .haira-attachment-option-icon svg {
    width: 19px !important;
    height: 19px !important;
  }

  body >
  .haira-attachment-menu
  .haira-attachment-option-text strong {
    font-size: 11px !important;
  }

  body >
  .haira-attachment-menu
  .haira-attachment-option-text small {
    font-size: 8px !important;
  }
}

@media (max-width: 350px) {
  body >
  .haira-attachment-menu.haira-sheet-ready {
    grid-template-columns: 1fr !important;
  }
}
