/* Custom Select Styles */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-wrapper select {
    display: none !important;
    /* Hide original select */
}

.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #1f2937;
    /* text-gray-800 */
    background-color: #fff;
    border: 1px solid #e5e7eb;
    /* border-gray-200 */
    border-radius: 0.5rem;
    /* rounded-lg */
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 42px;
    /* Ensure height matches inputs */
}

.custom-select-trigger:hover {
    border-color: #d1d5db;
    /* border-gray-300 */
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
    /* ring-primary/20 */
}

.custom-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.custom-select-arrow {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    transition: transform 0.2s ease;
    color: #9ca3af;
    /* text-gray-400 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-select-wrapper.open .custom-select-arrow {
    transform: translateY(-50%) rotate(180deg);
    color: var(--primary-color);
}

.custom-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    /* slightly larger radius for dropdown */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: #fff;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 50;
    margin-top: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    transform: translateY(-10px) scale(0.98);
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

.custom-option {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.1s ease;
}

.custom-option:hover {
    background-color: #f9fafb;
    /* bg-gray-50 */
    color: var(--primary-color);
}

.custom-option.selected {
    background-color: #eff6ff;
    /* bg-blue-50 */
    color: var(--primary-color);
    font-weight: 500;
}

/* Color badges for title color select */
.color-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}