/* model-selector.css */

/* Model Selector Styles: ChatGPT-like dropdown */
.dropdown-container {
    position: relative;
}

.dropdown-toggle {
    padding: 0.5rem 1rem;
    background: transparent; /* Blends with header, no 'island' when idle */
    color: var(--text-primary);
    border: none; /* Remove border to match ChatGPT's idle state */
    border-radius: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    outline: none;
}

/* Highlight on hover or when open, matching ChatGPT's #f5f5f5 */
.dropdown-toggle:hover,
.dropdown-toggle.open {
    background: var(--selector-hover-bg); /* Uses #f5f5f5 in light mode, rgb(47,47,47) in dark */
}

/* Arrow styling */
.dropdown-toggle .arrow {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

/* Dropdown menu styling, mimicking ChatGPT */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    width: 340px; /* Matches ChatGPT's min-width */
    background: var(--main-bg);
    border-radius: 1rem; /* Rounded corners like ChatGPT */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); /* Matches ChatGPT's shadow */
    opacity: 0;
    transform: scale(0.95);
    transform-origin: top;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 50;
    padding: 0.5rem;
    pointer-events: none;
    color: var(--text-primary);
}

/* Open state for dropdown */
.dropdown-menu.open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Dropdown option styling */
.dropdown-option {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 0.5rem;
    position: relative;
}

/* Hover effect for options, matching ChatGPT's #f5f5f5 */
.dropdown-option:hover {
    background: var(--selector-hover-bg);
}

/* Show checkmark when selected */
.dropdown-option.selected .checkmark-circle {
    display: flex;
}

/* Icon styling, adjusted to match ChatGPT's size */
.icon {
    width: 28px; /* Matches ChatGPT's h-7 w-7 (1.75rem = 28px) */
    height: 28px;
    margin-right: 0.5rem;
    flex-shrink: 0;
    background-color: var(--icon-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    z-index: 1; /* Ensure icons are above overlapping elements */
}

/* Updated SVG styling for icons */
.icon svg {
    width: 16px; /* Matches ChatGPT's h-4 w-4 */
    height: 16px;
    fill: none;         /* No fill, to let stroke show */
    stroke: currentColor; /* Use current text color for the stroke */
    stroke-width: 2;     /* Adjust stroke width as needed */
}

/* Model name and description styling */
.model-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.description {
    font-size: 0.75rem;
    color: var(--description-color);
    margin-top: 0.25rem;
    display: block;
}

/* Checkmark circle styling */
.checkmark-circle {
    margin-left: auto;
    display: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--checkmark-bg);
    color: var(--checkmark-color);
    font-size: 14px;
    font-weight: bold;
}

.checkmark {
    display: inline-block;
}

.dropdown-option[data-model="AGCT-1o"] .icon svg path {
    fill: currentColor;
    stroke: none;
}

.dropdown-option[data-model="SAT-2.6"] .icon svg path {
    fill: currentColor;
    stroke: none;
  }

  body.dark-mode .dropdown-menu {
    background: rgb(47,47,47);
}

/* Dark mode dropdown option hover background */
body.dark-mode .dropdown-option:hover {
    background: rgb(66,66,66);
}

body:not(.dark-mode) .dropdown-option:hover {
    background: rgb(245,245,245);
}