/* ================================================
   Font Picker — Custom dropdown for font selection
   ================================================ */

.font-picker {
    position: relative;
    width: 100%;

    &__selected {
        display: flex;
        align-items: center;
        padding: 0.5rem 0.75rem;
        border: 1px solid #d1d5db;
        border-radius: 0.5rem;
        background: #fff;
        cursor: pointer;
        font-size: 1rem;
        min-height: 42px;
        transition: border-color 0.15s, box-shadow 0.15s;
        user-select: none;

        // Chevron
        &::after {
            content: '';
            margin-left: auto;
            padding-left: 1rem;
            border-left: 5px solid transparent;
            border-right: 5px solid transparent;
            border-top: 5px solid #6b7280;
            flex-shrink: 0;
        }

        &:hover {
            border-color: #3b82f6;
        }

        &:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
        }
    }

    &__dropdown {
        display: none;
        position: absolute;
        z-index: 1000;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        max-height: 360px;
        overflow-y: auto;
        background: #fff;
        border: 1px solid #d1d5db;
        border-radius: 0.5rem;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

        // Scrollbar
        &::-webkit-scrollbar {
            width: 6px;
        }
        &::-webkit-scrollbar-track {
            background: transparent;
        }
        &::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }
    }

    &--open &__dropdown {
        display: block;
    }

    &--open &__selected {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }

    &__item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.6rem 0.75rem;
        cursor: pointer;
        border-bottom: 1px solid #f3f4f6;
        transition: background 0.1s;

        &:last-child {
            border-bottom: none;
        }

        &:hover {
            background: #eff6ff;
        }

        &--active {
            background: #dbeafe;

            &:hover {
                background: #dbeafe;
            }

            .font-picker__name {
                color: #1d4ed8;
                font-weight: 700;
            }
        }
    }

    &__name {
        font-size: 0.95rem;
        font-weight: 600;
        color: #1f2937;
        min-width: 160px;
        flex-shrink: 0;
    }

    &__preview {
        font-size: 1.1rem;
        color: #374151;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    &__category {
        font-size: 0.7rem;
        font-family: 'Inter', sans-serif !important;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        flex-shrink: 0;
        background: #f3f4f6;
        padding: 0.15rem 0.5rem;
        border-radius: 0.25rem;
    }
}
