/* Mode Selector Dropdown - Ultra Polished Design */

/* Base mode selector styling with proper positioning */
.sage-ai-mode-selector {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background-color: var(--jp-layout-color0);
  border: 1px solid var(--jp-border-color1);
  border-radius: 8px;
  cursor: pointer;
  font-size: var(--jp-ui-font-size1);
  color: var(--jp-ui-font-color0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
  backdrop-filter: blur(8px);
  z-index: 10; /* Ensure it's above other input elements */
}

.sage-ai-mode-selector-arrow {
  display: flex;
  align-items: center;
}

.sage-ai-mode-selector:hover {
  border: 1px solid var(--jp-ui-font-color1);

  /* background: linear-gradient( */

  /*  135deg, */

  /*  var(--jp-layout-color3) 0%, */

  /*  var(--jp-layout-color4) 100% */

  /* ); */

  /* border-color: var(--jp-brand-color1); */

  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); */

  /* transform: translateY(-1px); */
}

.sage-ai-mode-selector:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgb(0 0 0 / 12%);
}

/* Mode display styling */
.sage-ai-mode-display {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.sage-ai-mode-display .sage-ai-mode-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.sage-ai-mode-display .sage-ai-mode-option-icon svg {
  width: 16px;
  height: 16px;
  transition: fill 0.2s ease;
}

.sage-ai-mode-display .sage-ai-mode-option-text {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* Dropdown arrow styling */
.sage-ai-mode-arrow {
  color: var(--jp-ui-font-color2);
  font-size: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-left: auto;
}

.sage-ai-mode-selector:hover .sage-ai-mode-arrow {
  color: var(--jp-brand-color1);
  transform: translateY(-1px);
}

.sage-ai-mode-selector.open .sage-ai-mode-arrow {
  transform: rotate(180deg);
  color: var(--jp-brand-color1);
}

/* Dropdown container */
.sage-ai-mode-dropdown {
  position: absolute;
  bottom: calc(100% + 8px); /* Position above the selector */
  left: 0;
  right: 0;
  min-width: 100%;
  background: var(--jp-layout-color1);
  border: .5px solid var(--jp-border-color1);
  border-radius: 12px;
  box-shadow:
    0 10px 40px rgb(0 0 0 / 15%),
    0 4px 12px rgb(0 0 0 / 10%),
    0 0 0 1px rgb(255 255 255 / 5%);
  z-index: 2000;
  overflow: hidden;
  backdrop-filter: blur(20px);

  /* Animation properties */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sage-ai-mode-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  width: fit-content !important;
}

.sage-ai-mode-dropdown.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
}

/* Dropdown options container */
.sage-ai-mode-dropdown-content {
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
}

/* Individual mode options */
.sage-ai-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  position: relative;
  overflow: hidden;
  background: transparent;
  border: 1px solid transparent;
}

/* Mode option icon */
.sage-ai-mode-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;

  /* background: var(--jp-layout-color2); */
  /*transition: all 0.4s ease;*/
  flex-shrink: 0;
}

.sage-ai-mode-option:hover {
  background: var(--jp-border-color1);
}

.sage-ai-mode-option-icon svg {
  width: 16px;
  height: 16px;
  transition: fill 0.2s ease;
}

/* Mode option text */
.sage-ai-mode-option-text {
  font-weight: 500;
  font-size: 14px;
  color: var(--jp-ui-font-color0);
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.3;
}

.sage-ai-mode-option:hover .sage-ai-mode-option-text {
  color: var(--jp-ui-font-color0);
}

/* Add mode descriptions */
.sage-ai-mode-option-description {
  font-size: 10px;
  color: var(--jp-ui-font-color2);
  transition: color 0.2s ease;
  line-height: 160%;
  margin: 0 !important;
}

.sage-ai-mode-option:hover .sage-ai-mode-option-description {
  color: var(--jp-ui-font-color1);
}

/* Enhanced flex layout for dropdown content */
.sage-ai-mode-dropdown {
  display: flex;
  flex-direction: column;
}

/* Staggered animation for options */
.sage-ai-mode-option:nth-child(1) {
  transition-delay: 0.05s;
}

.sage-ai-mode-option:nth-child(2) {
  transition-delay: 0.1s;
}

.sage-ai-mode-option:nth-child(3) {
  transition-delay: 0.15s;
}

/* Loading animation when opening */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* Enhanced opening animation */
.sage-ai-mode-dropdown.opening {
  animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.sage-ai-mode-dropdown.closing {
  animation: slideOutDown 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Subtle glow effect for active/focused state */
.sage-ai-mode-selector:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--jp-border-color1),
    0 4px 12px rgb(0 0 0 / 15%);
}

/* Dark theme adjustments */
[data-jp-theme-name='JupyterLab Dark'] .sage-ai-mode-dropdown {
  box-shadow:
    0 10px 40px rgb(0 0 0 / 30%),
    0 4px 12px rgb(0 0 0 / 20%),
    0 0 0 1px rgb(255 255 255 / 10%);
}

.sage-ai-mode-option-title {
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
  margin: 0 !important;
  line-height: 155%;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .sage-ai-mode-dropdown {
    bottom: calc(100% + 4px);
  }

  .sage-ai-mode-option {
    padding: 10px 14px;
  }

  .sage-ai-mode-option-text {
    font-size: 13px;
  }
}
